Modify and Execute Next Sequential Instruction Facility and Instructions Therefore

ABSTRACT

An modify next sequential instruction (MNSI) instruction, when executed, modifies a field of the fetched copy of the next sequential instruction (NSI) to enable a program to dynamically provide parameters to the NSI being executed. Thus the MNSI instruction is a non-disruptive prefix instruction to the NSI. The NSI may be modified to effectively extend the length of the NSI field, thus providing more registers or more range (in the case of a length field) than otherwise available to the NSI instruction according to the instruction set architecture (ISA)

FIELD OF THE INVENTION

The present invention is related to computer systems and moreparticularly to computer system processor instruction functionality.

BACKGROUND OF THE INVENTION

Trademarks: IBM® is a registered trademark of International BusinessMachines Corporation, Armonk, N.Y., U.S.A. S/390, Z900 and z990 andother product names may be registered trademarks or product names ofInternational Business Machines Corporation or other companies.

IBM has created through the work of many highly talented engineersbeginning with machines known as the IBM® System 360 in the 1960s to thepresent, a special architecture which, because of its essential natureto a computing system, became known as “the mainframe” whose principlesof operation state the architecture of the machine by describing theinstructions which may be executed upon the “mainframe” implementationof the instructions which had been invented by IBM inventors andadopted, because of their significant contribution to improving thestate of the computing machine represented by “the mainframe”, assignificant contributions by inclusion in IBM's Principles of Operationas stated over the years. The IBM Z/Architecture® Principles ofOperation, Publication SA22-7832-09 is incorporated by reference in itsentirety herein.

BRIEF SUMMARY

In a computer system, a computer implemented method is providedcomprising: fetching at an address specified by a program counter aprefix machine instruction and a first next sequential instruction(NSI), the prefix machine instruction and the first NSI defined for acomputer architecture, the first NSI directly following the prefixmachine instruction in program order; and executing the fetched prefixmachine instruction and first NSI, the executing comprising: a)modifying a field of the fetched first NSI based on a value specified bythe prefix machine instruction to produce a modified first NSI; and b)executing the modified first NSI; and c) incrementing the programcounter to point to a second NSI, the second NSI directly following thefirst NSI in program order; and executing the second NSI.

In an embodiment, the field of the first NSI consists of any one of animmediate field, an index field or a length field.

In an embodiment, the prefix instruction further comprises a firstregister field, the modifying further comprises: obtaining the valuefrom a register specified by the first register field; and replacing thefield of the fetched first NSI with a replacement value based on thevalue specified by the prefix machine instruction.

In an embodiment, based on the first register field being any one of oneor more first register field values, the modifying further comprises:obtaining the value from a low order portion of the register specifiedby the first register field; performing any one of a logical OR, AND orEXCLUSIVE OR of the value with the field of the fetched first NSI toform the replacement value.

In an embodiment, based on an opcode field of the first NSI comprisingbits of the field of the fetched first NSI, executing the fetched prefixmachine instruction and first NSI is aborted and an error condition issignaled.

In an embodiment, based on information provided by the prefix machineinstruction, a location in the fetched first NSI of the field of thefetched first NSI is determined.

In an embodiment, the information is extracted from a register specifiedby the prefix machine instruction, the information defining the locationof the field of the first NSI.

In an embodiment, the field of the modified NSI is larger than the fieldof the NSI wherein the field of the modified NSI comprises a valuegreater than any value supported by the field of the NSI.

BRIEF DESCRIPTION OF THE DRAWINGS

The subject matter which is regarded as the invention is particularlypointed out and distinctly claimed in the claims at the conclusion ofthe specification. The foregoing and other objects, features, andadvantages of the invention are apparent from the following detaileddescription taken in conjunction with the accompanying drawings inwhich:

FIG. 1A is a diagram depicting an example Host computer system;

FIG. 1B is a diagram depicting an example emulation Host computersystem;

FIG. 1C is a diagram depicting an example computer system;

FIG. 2 is a diagram depicting an example computer network;

FIG. 3 is a diagram depicting an elements of a computer system;

FIGS. 4A-4C depict detailed elements of a computer system;

FIGS. 5A-5F depict machine instruction format of a computer system;

FIG. 6 depicts an instruction format of an embodiment;

FIG. 7 depicts a flow of an aspect of an embodiment;

FIG. 8 depicts a flow of another aspect an embodiment;

FIG. 9 depicts a flow of a MNSI-NSI sequence;

FIG. 10 depicts a flow of embodiments;

FIG. 11 depicts a flow extending a range of an NSI;

FIG. 12 depicts a flow for an MNSI prediction embodiment;

FIG. 13 depicts a flow of an embodiment;

FIG. 14 depicts a flow of an embodiment;

FIG. 15 depicts a flow of an embodiment; and

FIG. 16 depicts a flow of an embodiment.

DETAILED DESCRIPTION

Referring to FIG. 1A, representative components of a Host Computersystem 50 are portrayed. Other arrangements of components may also beemployed in a computer system, which are well known in the art. Therepresentative Host Computer 50 comprises one or more CPUs 1 incommunication with main store (Computer Memory 2) as well as I/Ointerfaces to storage devices 11 and networks 10 for communicating withother computers or SANs and the like. The CPU 1 is complient with anarchitecture having an architected instruction set and architectedfunctionality. The CPU 1 may have Dynamic Address Translation (DAT) 3for transforming program addresses (virtual addresses) into real addressof memory. A DAT typically includes a Translation Lookaside Buffer (TLB)7 for caching translations so that later accesses to the block ofcomputer memory 2 do not require the delay of address translation.Typically a cache 9 is employed between Computer Memory 2 and theProcessor 1. The cache 9 may be hierarchical having a large cacheavailable to more than one CPU and smaller, faster (lower level) cachesbetween the large cache and each CPU. In some implementations the lowerlevel caches are split to provide separate low level caches forinstruction fetching and data accesses. In an embodiment, an instructionis fetched from memory 2 by an instruction fetch unit 4 via a cache 9.The instruction is decoded in an instruction decode unit (6) anddispatched (with other instructions in some embodiments) to instructionexecution units 8. Typically several execution units 8 are employed, forexample an arithmetic execution unit, a floating point execution unitand a branch instruction execution unit. The instruction is executed bythe execution unit, accessing operands from instruction specifiedregisters or memory as needed. If an operand is to be accessed (loadedor stored) from memory 2, a load store unit 5 typically handles theaccess under control of the instruction being executed. Instructions maybe executed in hardware circuits or in internal microcode (firmware) orby a combination of both.

In FIG. 1B, an example of an emulated Host Computer system 21 isprovided that emulates a Host computer system 50 of a Host architecture.In the emulated Host Computer system 21, the Host processor (CPU) 1 isan emulated Host processor (or virtual Host processor) and comprises anemulation processor 27 having a different native instruction setarchitecture than that of the processor 1 of the Host Computer 50. Theemulated Host Computer system 21 has memory 22 accessible to theemulation processor 27. In the example embodiment, the Memory 27 ispartitioned into a Host Computer Memory 2 portion and an EmulationRoutines 23 portion. The Host Computer Memory 2 is available to programsof the emulated Host Computer 21 according to Host ComputerArchitecture. The emulation Processor 27 executes native instructions ofan architected instruction set of an architecture other than that of theemulated processor 1, the native instructions obtained from EmulationRoutines memory 23, and may access a Host instruction for execution froma program in Host Computer Memory 2 by employing one or moreinstruction(s) obtained in a Sequence & Access/Decode routine which maydecode the Host instruction(s) accessed to determine a nativeinstruction execution routine for emulating the function of the Hostinstruction accessed. Other facilities that are defined for the HostComputer System 50 architecture may be emulated by ArchitectedFacilities Routines, including such facilities as General PurposeRegisters, Control Registers, Dynamic Address Translation and I/OSubsystem support and processor cache for example. The EmulationRoutines may also take advantage of function available in the emulationProcessor 27 (such as general registers and dynamic translation ofvirtual addresses) to improve performance of the Emulation Routines.Special Hardware and Off-Load Engines may also be provided to assist theprocessor 27 in emulating the function of the Host Computer 50.

In a mainframe, architected machine instructions are used byprogrammers, usually today “C” programmers often by way of a compilerapplication. These instructions stored in the storage medium may beexecuted natively in a z/Architecture IBM Server, or alternatively inmachines executing other architectures. They can be emulated in theexisting and in future IBM mainframe servers and on other machines ofIBM (e.g. pSeries® Servers and xSeries® Servers). They can be executedin machines running Linux on a wide variety of machines using hardwaremanufactured by IBM®, Intel®, AMD™, Sun Microsystems and others. Besidesexecution on that hardware under a Z/Architecture®, Linux can be used aswell as machines which use emulation by Hercules, UMX, FSI (FundamentalSoftware, Inc) or Platform Solutions, Inc. (PSI), where generallyexecution is in an emulation mode. In emulation mode, emulation softwareis executed by a native processor to emulate the architecture of anemulated processor.

The native processor 27 typically executes emulation software 23comprising either firmware or a native operating system to performemulation of the emulated processor. The emulation software 23 isresponsible for fetching and executing instructions of the emulatedprocessor architecture. The emulation software 23 maintains an emulatedprogram counter to keep track of instruction boundaries. The emulationsoftware 23 may fetch one or more emulated machine instructions at atime and convert the one or more emulated machine instructions to acorresponding group of native machine instructions for execution by thenative processor 27. These converted instructions may be cached suchthat a faster conversion can be accomplished. Not withstanding, theemulation software must maintain the architecture rules of the emulatedprocessor architecture so as to assure operating systems andapplications written for the emulated processor operate correctly.Furthermore the emulation software must provide resources identified bythe emulated processor 1 architecture including, but not limited tocontrol registers, general purpose registers, floating point registers,dynamic address translation function including segment tables and pagetables for example, interrupt mechanisms, context switch mechanisms,Time of Day (TOD) clocks and architected interfaces to I/O subsystemssuch that an operating system or an application program designed to runon the emulated processor, can be run on the native processor having theemulation software.

A specific instruction being emulated is decoded, and a subroutinecalled to perform the function of the individual instruction. Anemulation software function 23 emulating a function of an emulatedprocessor 1 is implemented, for example, in a “C” subroutine or driver,or some other method of providing a driver for the specific hardware aswill be within the skill of those in the art after understanding thedescription of the preferred embodiment. Various software and hardwareemulation patents including, but not limited to U.S. Pat. No. 5,551,013for a “Multiprocessor for hardware emulation” of Beausoleil et al., andU.S. Pat. No. 6,009,261: Preprocessing of stored target routines foremulating incompatible instructions on a target processor” of Scalzi etal; and U.S. Pat. No. 5,574,873: Decoding guest instruction to directlyaccess emulation routines that emulate the guest instructions, ofDavidian et al; U.S. Pat. No. 6,308,255: Symmetrical multiprocessing busand chipset used for coprocessor support allowing non-native code to runin a system, of Gorishek et al; and U.S. Pat. No. 6,463,582: Dynamicoptimizing object code translator for architecture emulation and dynamicoptimizing object code translation method of Lethin et al; and U.S. Pat.No. 5,790,825: Method for emulating guest instructions on a hostcomputer through dynamic recompilation of host instructions of EricTraut, all of the forgoing patents are incorporated by reference herein;and many others, illustrate the a variety of known ways to achieveemulation of an instruction format architected for a different machinefor a target machine available to those skilled in the art, as well asthose commercial software techniques used by those referenced above.

What is needed is new instruction functionality consistent with existingarchitecture that relieves dependency on architecture resources such asgeneral registers, improves functionality and performance of softwareversions employing the new instruction.

Referring to FIG. 1A, software program code which embodies the presentinvention is typically accessed by the processor also known as a CPU(Central Processing Unit) 1 of the system 50 from long-term storagemedia 7, such as a CD-ROM drive, tape drive or hard drive. The softwareprogram code may be embodied on any of a variety of known media for usewith a data processing system, such as a diskette, hard drive, orCD-ROM. The code may be distributed on such media, or may be distributedto users from the computer memory 2 or storage of one computer systemover a network 10 to other computer systems for use by users of suchother systems.

Alternatively, the program code may be embodied in the memory 2, andaccessed by the processor 1 using the processor bus. Such program codeincludes an operating system which controls the function and interactionof the various computer components and one or more application programs.Program code is normally paged from dense storage media 11 to high-speedmemory 2 where it is available for processing by the processor 1. Thetechniques and methods for embodying software program code in memory, onphysical media, and/or distributing software code via networks are wellknown and will not be further discussed herein. Program code, whencreated and stored on a tangible medium (including but not limited toelectronic memory modules (RAM), flash memory, Compact Discs (CDs),DVDs, Magnetic Tape and the like is often referred to as a “computerprogram product”. The computer program product medium is typicallyreadable by a processing circuit preferably in a computer system forexecution by the processing circuit.

FIG. 1C illustrates a representative workstation or server hardwaresystem in which the present invention may be practiced. The system 100of FIG. 1C comprises a representative computer system 101, such as apersonal computer, a workstation or a server, including optionalperipheral devices. The workstation 101 includes one or more processors106 and a bus employed to connect and enable communication between theprocessor(s) 106 and the other components of the system 101 inaccordance with known techniques. The bus connects the processor 106 tomemory 105 and long-term storage 107 which can include a hard drive(including any of magnetic media, CD, DVD and Flash Memory for example)or a tape drive for example. The system 101 might also include a userinterface adapter, which connects the microprocessor 106 via the bus toone or more interface devices, such as a keyboard 104, mouse 103, aPrinter/scanner 110 and/or other interface devices, which can be anyuser interface device, such as a touch sensitive screen, digitized entrypad, etc. The bus also connects a display device 102, such as an LCDscreen or monitor, to the microprocessor 106 via a display adapter.

The system 101 may communicate with other computers or networks ofcomputers by way of a network adapter capable of communicating 108 witha network 109. Example network adapters are communications channels,token ring, Ethernet or modems. Alternatively, the workstation 101 maycommunicate using a wireless interface, such as a CDPD (cellular digitalpacket data) card. The workstation 101 may be associated with such othercomputers in a Local Area Network (LAN) or a Wide Area Network (WAN), orthe workstation 101 can be a client in a client/server arrangement withanother computer, etc. All of these configurations, as well as theappropriate communications hardware and software, are known in the art.

FIG. 2 illustrates a data processing network 200 in which the presentinvention may be practiced. The data processing network 200 may includea plurality of individual networks, such as a wireless network and awired network, each of which may include a plurality of individualworkstations 101 201 202 203 204. Additionally, as those skilled in theart will appreciate, one or more LANs may be included, where a LAN maycomprise a plurality of intelligent workstations coupled to a hostprocessor.

Still referring to FIG. 2, the networks may also include mainframecomputers or servers, such as a gateway computer (client server 206) orapplication server (remote server 208 which may access a data repositoryand may also be accessed directly from a workstation 205). A gatewaycomputer 206 serves as a point of entry into each network 207. A gatewayis needed when connecting one networking protocol to another. Thegateway 206 may be preferably coupled to another network (the Internet207 for example) by means of a communications link. The gateway 206 mayalso be directly coupled to one or more workstations 101 201 202 203 204using a communications link. The gateway computer may be implementedutilizing an IBM eServer™ zSeries® z9® Server available from IBM Corp.

Software programming code which embodies the present invention istypically accessed by the processor 106 of the system 101 from long-termstorage media 107, such as a CD-ROM drive or hard drive. The softwareprogramming code may be embodied on any of a variety of known media foruse with a data processing system, such as a diskette, hard drive, orCD-ROM. The code may be distributed on such media, or may be distributedto users 210 211 from the memory or storage of one computer system overa network to other computer systems for use by users of such othersystems.

Alternatively, the programming code 111 may be embodied in the memory105, and accessed by the processor 106 using the processor bus. Suchprogramming code includes an operating system which controls thefunction and interaction of the various computer components and one ormore application programs 112. Program code is normally paged from densestorage media 107 to high-speed memory 105 where it is available forprocessing by the processor 106. The techniques and methods forembodying software programming code in memory, on physical media, and/ordistributing software code via networks are well known and will not befurther discussed herein. Program code, when created and stored on atangible medium (including but not limited to electronic memory modules(RAM), flash memory, Compact Discs (CDs), DVDs, Magnetic Tape and thelike is often referred to as a “computer program product”. The computerprogram product medium is typically readable by a processing circuitpreferably in a computer system for execution by the processing circuit.

The cache that is most readily available to the processor (normallyfaster and smaller than other caches of the processor) is the lowest (L1or level one) cache and main store (main memory) is the highest levelcache (L3 if there are 3 levels). The lowest level cache is oftendivided into an instruction cache (I-Cache) holding machine instructionsto be executed and a data cache (D-Cache) holding data operands.

Referring to FIG. 3, an exemplary processor embodiment is depicted forprocessor 106. Typically one or more levels of Cache 303 are employed tobuffer memory blocks in order to improve processor performance. Thecache 303 is a high speed buffer holding cache lines of memory data thatare likely to be used. Typical cache lines are 64, 128 or 256 bytes ofmemory data. Separate Caches are often employed for caching instructionsthan for caching data. Cache coherence (synchronization of copies oflines in Memory and the Caches) is often provided by various “Snoop”algorithms well known in the art. Main storage 105 of a processor systemis often referred to as a cache. In a processor system having 4 levelsof cache 303 main storage 105 is sometimes referred to as the level 5(L5) cache since it is typically faster and only holds a portion of thenon-volatile storage (DASD, Tape etc) that is available to a computersystem. Main storage 105 “caches” pages of data paged in and out of themain storage 105 by the Operating system.

A program counter (instruction counter) 311 keeps track of the addressof the current instruction to be executed. A program counter in az/Architecture processor is 64 bits and can be truncated to 31 or 24bits to support prior addressing limits. A program counter is typicallyembodied in a PSW (program status word) of a computer such that itpersists during context switching. Thus, a program in progress, having aprogram counter value, may be interrupted by, for example, the operatingsystem (context switch from the program environment to the Operatingsystem environment). The PSW of the program maintains the programcounter value while the program is not active, and the program counter(in the PSW) of the operating system is used while the operating systemis executing. Typically the Program counter is incremented by an amountequal to the number of bytes of the current instruction. RISC (ReducedInstruction Set Computing) instructions are typically fixed length whileCISC (Complex Instruction Set Computing) instructions are typicallyvariable length. Instructions of the IBM z/Architecture are CISCinstructions having a length of 2, 4 or 6 bytes. The Program counter 311is modified by either a context switch operation or a Branch takenoperation of a Branch instruction for example. In a context switchoperation, the current program counter value is saved in a ProgramStatus Word (PSW) along with other state information about the programbeing executed (such as condition codes), and a new program countervalue is loaded pointing to an instruction of a new program module to beexecuted. A branch taken operation is performed in order to permit theprogram to make decisions or loop within the program by loading theresult of the Branch Instruction into the Program Counter 311.

Typically an instruction Fetch Unit 305 is employed to fetchinstructions on behalf of the processor 106. The fetch unit eitherfetches “next sequential instructions”, target instructions of BranchTaken instructions, or first instructions of a program following acontext switch. Modern Instruction fetch units often employ prefetchtechniques to speculatively prefetch instructions based on thelikelihood that the prefetched instructions might be used. For example,a fetch unit may fetch 16 bytes of instruction that includes the nextsequential instruction and additional bytes of further sequentialinstructions.

The fetched instructions are then executed by the processor 106. In anembodiment, the fetched instruction(s) are passed to a dispatch unit 306of the fetch unit. The dispatch unit decodes the instruction(s) andforwards information about the decoded instruction(s) to appropriateunits 307 308 310. An execution unit 307 will typically receiveinformation about decoded arithmetic instructions from the instructionfetch unit 305 and will perform arithmetic operations on operandsaccording to the opcode of the instruction. Operands are provided to theexecution unit 307 preferably either from memory 105, architectedregisters 309 or from an immediate field of the instruction beingexecuted. Results of the execution, when stored, are stored either inmemory 105, registers 309 or in other machine hardware (such as controlregisters, PSW registers and the like).

A processor 106 typically has one or more execution units 307 308 310for executing the function of the instruction. Referring to FIG. 4A, anexecution unit 307 may communicate with architected general registers309, a decode/dispatch unit 306 a load store unit 310 and other 401processor units by way of interfacing logic 407. An Execution unit 307may employ several register circuits 403 404 405 to hold informationthat the arithmetic logic unit (ALU) 402 will operate on. The ALUperforms arithmetic operations such as add, subtract, multiply anddivide as well as logical function such as and, or and exclusive-or(xor), rotate and shift. Preferably the ALU supports specializedoperations that are design dependent. Other circuits may provide otherarchitected facilities 408 including condition codes and recoverysupport logic for example. Typically the result of an ALU operation isheld in an output register circuit 406 which can forward the result to avariety of other processing functions. There are many arrangements ofprocessor units, the present description is only intended to provide arepresentative understanding of one embodiment.

An ADD instruction for example would be executed in an execution unit307 having arithmetic and logical functionality while a Floating Pointinstruction for example would be executed in a Floating Point Executionhaving specialized Floating Point capability. Preferably, an executionunit operates on operands identified by an instruction by performing anopcode defined function on the operands. For example, an ADD instructionmay be executed by an execution unit 307 on operands found in tworegisters 309 identified by register fields of the instruction.

The execution unit 307 performs the arithmetic addition on two operandsand stores the result in a third operand where the third operand may bea third register or one of the two source registers. The Execution unitpreferably utilizes an Arithmetic Logic Unit (ALU) 402 that is capableof performing a variety of logical functions such as Shift, Rotate, And,Or and XOR as well as a variety of algebraic functions including any ofadd, subtract, multiply, divide. Some ALUs 402 are designed for scalaroperations and some for floating point. Data may be Big Endian (wherethe least significant byte is at the highest byte address) or LittleEndian (where the least significant byte is at the lowest byte address)depending on architecture. The IBM z/Architecture is Big Endian. Signedfields may be sign and magnitude, 1's complement or 2's complementdepending on architecture. A 2's complement number is advantageous inthat the ALU does not need to design a subtract capability since eithera negative value or a positive value in 2's complement requires only andaddition within the ALU. Numbers are commonly described in shorthand,where a 12 bit field defines an address of a 4,096 byte block and iscommonly described as a 4 Kbyte (Kilo-byte) block for example.

Referring to FIG. 4B, Branch instruction information for executing abranch instruction is typically sent to a branch unit 308 which oftenemploys a branch prediction algorithm such as a branch history table 432to predict the outcome of the branch before other conditional operationsare complete. The target of the current branch instruction will befetched and speculatively executed before the conditional operations arecomplete. When the conditional operations are completed thespeculatively executed branch instructions are either completed ordiscarded based on the conditions of the conditional operation and thespeculated outcome. A typical branch instruction may test conditioncodes and branch to a target address if the condition codes meet thebranch requirement of the branch instruction, a target address may becalculated based on several numbers including ones found in registerfields or an immediate field of the instruction for example. The branchunit 308 may employ an ALU 426 having a plurality of input registercircuits 427 428 429 and an output register circuit 430. The branch unit308 may communicate with general registers 309, decode dispatch unit 306or other circuits 425 for example.

The execution of a group of instructions can be interrupted for avariety of reasons including a context switch initiated by an operatingsystem, a program exception or error causing a context switch, an I/Ointerruption signal causing a context switch or multi-threading activityof a plurality of programs (in a multi-threaded environment) forexample. Preferably a context switch action saves state informationabout a currently executing program and then loads state informationabout another program being invoked. State information may be saved inhardware registers or in memory for example. State informationpreferably comprises a program counter value pointing to a nextinstruction to be executed, condition codes, memory translationinformation and architected register content. A context switch activitycan be exercised by hardware circuits, application programs, operatingsystem programs or firmware code (microcode, pico-code or licensedinternal code (LIC) alone or in combination.

A processor accesses operands according to instruction defined methods.The instruction may provide an immediate operand using the value of aportion of the instruction, may provide one or more register fieldsexplicitly pointing to either general purpose registers or specialpurpose registers (floating point registers for example). Theinstruction may utilize implied registers identified by an opcode fieldas operands. The instruction may utilize memory locations for operands.A memory location of an operand may be provided by a register, animmediate field, or a combination of registers and immediate field asexemplified by the z/Architecture long displacement facility wherein theinstruction defines a Base register, an Index register and an immediatefield (displacement field) that are added together to provide theaddress of the operand in memory for example. Location herein typicallyimplies a location in main memory (main storage) unless otherwiseindicated.

Referring to FIG. 4C, a processor accesses storage using a Load/Storeunit 310. The Load/Store unit 310 may perform a Load operation byobtaining the address of the target operand in memory 303 and loadingthe operand in a register 309 or another memory 303 location, or mayperform a Store operation by obtaining the address of the target operandin memory 303 and storing data obtained from a register 309 or anothermemory 303 location in the target operand location in memory 303. TheLoad/Store unit 310 may be speculative and may access memory in asequence that is out-of-order relative to instruction sequence, howeverthe Load/Store unit 310 must maintain the appearance to programs thatinstructions were executed in order. A load/store unit 310 maycommunicate with general registers 309, decode/dispatch unit 306,Cache/Memory interface 303 or other elements 455 and comprises variousregister circuits, ALUs 458 and control logic 463 to calculate storageaddresses and to provide pipeline sequencing to keep operationsin-order. Some operations may be out of order but the Load/Store unitprovides functionality to make the out of order operations to appear tothe program as having been performed in order as is well known in theart.

Preferably addresses that an application program “sees” are oftenreferred to as virtual addresses. Virtual addresses are sometimesreferred to as “logical addresses” and “effective addresses”. Thesevirtual addresses are virtual in that they are redirected to physicalmemory location by one of a variety of Dynamic Address Translation (DAT)312 technologies including, but not limited to simply prefixing avirtual address with an offset value, translating the virtual addressvia one or more translation tables, the translation tables preferablycomprising at least a segment table and a page table alone or incombination, preferably, the segment table having an entry pointing tothe page table. In z/Architecture, a hierarchy of translation isprovided including a region first table, a region second table, a regionthird table, a segment table and an optional page table. The performanceof the address translation is often improved by utilizing a TranslationLook-aside Buffer (TLB) which comprises entries mapping a virtualaddress to an associated physical memory location. The entries arecreated when DAT 312 translates a virtual address using the translationtables. Subsequent use of the virtual address can then utilize the entryof the fast TLB rather than the slow sequential Translation tableaccesses. TLB content may be managed by a variety of replacementalgorithms including LRU (Least Recently used).

In the case where the Processor is a processor of a multi-processorsystem, each processor has responsibility to keep shared resources suchas I/O, caches, TLBs and Memory interlocked for coherency. Typically“snoop” technologies will be utilized in maintaining cache coherency. Ina snoop environment, each cache line may be marked as being in any oneof a shared state, an exclusive state, a changed state, an invalid stateand the like in order to facilitate sharing.

I/O units 304 provide the processor with means for attaching toperipheral devices including Tape, Disc, Printers, Displays, andnetworks for example. I/O units are often presented to the computerprogram by software Drivers. In Mainframes such as the z/Series fromIBM, Channel Adapters and Open System Adapters are I/O units of theMainframe that provide the communications between the operating systemand peripheral devices.

The following description from the z/Architecture Principles ofOperation describes an architectural view of a computer system:

Storage:

A computer system includes information in main storage, as well asaddressing, protection, and reference and change recording. Some aspectsof addressing include the format of addresses, the concept of addressspaces, the various types of addresses, and the manner in which one typeof address is translated to another type of address. Some of mainstorage includes permanently assigned storage locations. Main storageprovides the system with directly addressable fast-access storage ofdata. Both data and programs must be loaded into main storage (frominput devices) before they can be processed.

Main storage may include one or more smaller, faster-access bufferstorages, sometimes called caches. A cache is typically physicallyassociated with a CPU or an I/O processor. The effects, except onperformance, of the physical construction and use of distinct storagemedia are generally not observable by the program.

Separate caches may be maintained for instructions and for dataoperands. Information within a cache is maintained in contiguous byteson an integral boundary called a cache block or cache line (or line, forshort). A model may provide an EXTRACT CACHE ATTRIBUTE instruction whichreturns the size of a cache line in bytes. A model may also providePREFETCH DATA and PREFETCH DATA RELATIVE LONG instructions which effectsthe prefetching of storage into the data or instruction cache or thereleasing of data from the cache.

Storage is viewed as a long horizontal string of bits. For mostoperations, accesses to storage proceed in a left-to-right sequence. Thestring of bits is subdivided into units of eight bits. An eight-bit unitis called a byte, which is the basic building block of all informationformats. Each byte location in storage is identified by a uniquenonnegative integer, which is the address of that byte location or,simply, the byte address. Adjacent byte locations have consecutiveaddresses, starting with 0 on the left and proceeding in a left-to-rightsequence. Addresses are unsigned binary integers and are 24, 31, or 64bits.

Information is transmitted between storage and a CPU or a channelsubsystem one byte, or a group of bytes, at a time. Unless otherwisespecified, a group of bytes in storage is addressed by the leftmost byteof the group. The number of bytes in the group is either implied orexplicitly specified by the operation to be performed. When used in aCPU operation, a group of bytes is called a field. Within each group ofbytes, bits are numbered in a left-to-right sequence. The leftmost bitsare sometimes referred to as the “high-order” bits and the rightmostbits as the “low-order” bits. Bit numbers are not storage addresses,however. Only bytes can be addressed. To operate on individual bits of abyte in storage, it is necessary to access the entire byte. The bits ina byte are numbered 0 through 7, from left to right. The bits in anaddress may be numbered 8-31 or 40-63 for 24-bit addresses or 1-31 or33-63 for 31-bit addresses; they are numbered 0-63 for 64-bit addresses.Within any other fixed-length format of multiple bytes, the bits makingup the format are consecutively numbered starting from 0. For purposesof error detection, and in preferably for correction, one or more checkbits may be transmitted with each byte or with a group of bytes. Suchcheck bits are generated automatically by the machine and cannot bedirectly controlled by the program. Storage capacities are expressed innumber of bytes. When the length of a storage-operand field is impliedby the operation code of an instruction, the field is said to have afixed length, which can be one, two, four, eight, or sixteen bytes.Larger fields may be implied for some instructions. When the length of astorage-operand field is not implied but is stated explicitly, the fieldis said to have a variable length. Variable-length operands can vary inlength by increments of one byte. When information is placed in storage,the contents of only those byte locations are replaced that are includedin the designated field, even though the width of the physical path tostorage may be greater than the length of the field being stored.

Certain units of information must be on an integral boundary in storage.A boundary is called integral for a unit of information when its storageaddress is a multiple of the length of the unit in bytes. Special namesare given to fields of 2, 4, 8, and 16 bytes on an integral boundary. Ahalfword is a group of two consecutive bytes on a two-byte boundary andis the basic building block of instructions. A word is a group of fourconsecutive bytes on a four-byte boundary. A doubleword is a group ofeight consecutive bytes on an eight-byte boundary. A quadword is a groupof 16 consecutive bytes on a 16-byte boundary. When storage addressesdesignate halfwords, words, doublewords, and quadwords, the binaryrepresentation of the address contains one, two, three, or fourrightmost zero bits, respectively. Instructions must be on two-byteintegral boundaries. The storage operands of most instructions do nothave boundary-alignment requirements.

On models that implement separate caches for instructions and dataoperands, a significant delay may be experienced if the program storesinto a cache line from which instructions are subsequently fetched,regardless of whether the store alters the instructions that aresubsequently fetched.

Instructions:

Typically, operation of the CPU is controlled by instructions in storagethat are executed sequentially, one at a time, left to right in anascending sequence of storage addresses. A change in the sequentialoperation may be caused by branching, LOAD PSW, interruptions, SIGNALPROCESSOR orders, or manual intervention.

Preferably an instruction comprises two major parts:

An operation code (op code), which specifies the operation to beperformedOptionally, the designation of the operands that participate.

Instruction formats of the z/Architecture are shown in FIGS. 5A-5F. Aninstruction can simply provide an Opcode 501, or an opcode and a varietyof fields including immediate operands or register specifiers forlocating operands in registers or in memory. The Opcode can indicate tothe hardware that implied resources (operands etc.) are to be used suchas one or more specific general purpose registers (GPRs). Operands canbe grouped in three classes: operands located in registers, immediateoperands, and operands in storage. Operands may be either explicitly orimplicitly designated. Register operands can be located in general,floating-point, access, or control registers, with the type of registeridentified by the op code. The register containing the operand isspecified by identifying the register in a four-bit field, called the Rfield, in the instruction. For some instructions, an operand is locatedin an implicitly designated register, the register being implied by theop code. Immediate operands are contained within the instruction, andthe 8-bit, 16-bit, or 32-bit field containing the immediate operand iscalled the I field. Operands in storage may have an implied length; bespecified by a bit mask; be specified by a four-bit or eight-bit lengthspecification, called the L field, in the instruction; or have a lengthspecified by the contents of a general register. The addresses ofoperands in storage are specified by means of a format that uses thecontents of a general register as part of the address. This makes itpossible to:

-   1. Specify a complete address by using an abbreviated notation-   2. Perform address manipulation using instructions which employ    general registers for operands-   3. Modify addresses by program means without alteration of the    instruction stream-   4. Operate independent of the location of data areas by directly    using addresses received from other programs

The address used to refer to storage either is contained in a registerdesignated by the R field in the instruction or is calculated from abase address, index, and displacement, specified by the B, X, and Dfields, respectively, in the instruction. When the CPU is in theaccess-register mode, a B or R field may designate an access register inaddition to being used to specify an address. To describe the executionof instructions, operands are preferably designated as first and secondoperands and, in some cases, third and fourth operands. In general, twooperands participate in an instruction execution, and the resultreplaces the first operand.

An instruction is one, two, or three halfwords in length and must belocated in storage on a halfword boundary. Referring to FIGS. 5A-5Fdepicting instruction formats, each instruction is in one of 25 basicformats: E 501, I 502, RI 503 504, RIE 505 551 552 553 554, RIL 506 507,RIS 555, RR 510, RRE 511, RRF 512 513 514, RRS, RS 516 517, RSI 520, RSL521, RSY 522 523, RX 524, RXE 525, RXF 526, RXY 527, S 530, SI 531, SIL556, SIY 532, SS 533 534 535 536 537, SSE 541 and SSF 542, with threevariations of RRF, two of RI, RIL, RS, and RSY, five of RIE and SS.

The format names indicate, in general terms, the classes of operandswhich participate in the operation and some details about fields:

RIS denotes a register-and-immediate operation and a storage operation.RRS denotes a register-and-register operation and a storage operation.SIL denotes a storage-and-immediate operation, with a 16-bit immediatefield.

In the I, RR, RS, RSI, RX, SI, and SS formats, the first byte of aninstruction contains the op code. In the E, RRE, RRF, S, SIL, and SSEformats, the first two bytes of an instruction contain the op code,except that for some instructions in the S format, the op code is inonly the first byte. In the RI and RIL formats, the op code is in thefirst byte and bit positions 12-15 of an instruction. In the RIE, RIS,RRS, RSL, RSY, RXE, RXF, RXY, and SIY formats, the op code is in thefirst byte and the sixth byte of an instruction. The first two bits ofthe first or only byte of the op code specify the length and format ofthe instruction, as follows:

In the RR, RRE, RRF, RRR, RX, RXE, RXF, RXY, RS, RSY, RSI, RI, RIE, andRIL formats, the contents of the register designated by the R1. fieldare called the first operand. The register containing the first operandis sometimes referred to as the “first operand location,” and sometimesas “register R1”. In the RR, RRE, RRF and RRR formats, the R2 fielddesignates the register containing the second operand, and the R2 fieldmay designate the same register as R1. In the RRF, RXF, RS, RSY, RSI,and RIE formats, the use of the R3 field depends on the instruction. Inthe RS and RSY formats, the R3 field may instead be an M3 fieldspecifying a mask. The R field designates a general or access registerin the general instructions, a general register in the controlinstructions, and a floating-point register or a general register in thefloating-point instructions. For general and control registers, theregister operand is in bit positions 32-63 of the 64-bit register oroccupies the entire register, depending on the instruction.

In the I format, the contents of the eight-bit immediate-data field, theI field of the instruction, are directly used as the operand. In the SIformat, the contents of the eight-bit immediate-data field, the 12 fieldof the instruction, are used directly as the second operand. The B1 andD1 fields specify the first operand, which is one byte in length. In theSIY format, the operation is the same except that DH1 and DL1 fields areused instead of a D1 field. In the RI format for the instructions ADDHALFWORD IMMEDIATE, COMPARE HALFWORD IMMEDIATE, LOAD HALFWORD IMMEDIATE,and MULTIPLY HALFWORD IMMEDIATE, the contents of the 16-bit I2 field ofthe instruction are used directly as a signed binary integer, and the R1field specifies the first operand, which is 32 or 64 bits in length,depending on the instruction. For the instruction TEST UNDER MASK (TMHH,TMHL, TMLH, TMLL), the contents of the I2 field are used as a mask, andthe R1 field specifies the first operand, which is 64 bits in length.

For the instructions INSERT IMMEDIATE, AND IMMEDIATE, OR IMMEDIATE, andLOAD LOGICAL IMMEDIATE, the contents of the I2 field are used as anunsigned binary integer or a logical value, and the R1 field specifiesthe first operand, which is 64 bits in length. For the relative-branchinstructions in the RI and RSI formats, the contents of the 16-bit I2field are used as a signed binary integer designating a number ofhalfwords. This number, when added to the address of the branchinstruction, specifies the branch address. For relative-branchinstructions in the RIL format, the I2 field is 32 bits and is used inthe same way.

For the relative-branch instructions in the RI and RSI formats, thecontents of the 16-bit I2 field are used as a signed binary integerdesignating a number of halfwords. This number, when added to theaddress of the branch instruction, specifies the branch address. Forrelative-branch instructions in the RIL format, the I2 field is 32 bitsand is used in the same way. For the RIE-format instructions COMPAREIMMEDIATE AND BRANCH RELATIVE and COMPARE LOGICAL IMMEDIATE AND BRANCHRELATIVE, the contents of the 8-bit I2 field is used directly as thesecond operand. For the RIE-format instructions COMPARE IMMEDIATE ANDBRANCH, COMPARE IMMEDIATE AND TRAP, COMPARE LOGICAL IMMEDIATE ANDBRANCH, and COMPARE LOGICAL IMMEDIATE AND TRAP, the contents of the16-bit I2 field are used directly as the second operand. For theRIE-format instructions COMPARE AND BRANCH RELATIVE, COMPARE IMMEDIATEAND BRANCH RELATIVE, COMPARE LOGICAL AND BRANCH RELATIVE, and COMPARELOGICAL IMMEDIATE AND BRANCH RELATIVE, the contents of the 16-bit I4field are used as a signed binary integer designating a number ofhalfwords that are added to the address of the instruction to form thebranch address.

For the RIL-format instructions ADD IMMEDIATE, ADD LOGICAL IMMEDIATE,ADD LOGICAL WITH SIGNED IMMEDIATE, COMPARE IMMEDIATE, COMPARE LOGICALIMMEDIATE, LOAD IMMEDIATE, and MULTIPLY SINGLE IMMEDIATE, the contentsof the 32-bit I2 field are used directly as a the second operand.

For the RIS-format instructions, the contents of the 8-bit I2 field areused directly as the second operand. In the SIL format, the contents ofthe 16-bit I2 field are used directly as the second operand. The B1 andD1 fields specify the first operand, as described below.

In the RSL, SI, SIL, SSE, and most SS formats, the contents of thegeneral register designated by the B1 field are added to the contents ofthe D1 field to form the first-operand address. In the RS, RSY, S, SIY,SS, and SSE formats, the contents of the general register designated bythe B2 field are added to the contents of the D2 field or DH2 and DL2fields to form the second-operand address. In the RX, RXE, RXF, and RXYformats, the contents of the general registers designated by the X2 andB2 fields are added to the contents of the D2 field or DH2 and DL2fields to form the second-operand address. In the RIS and RRS formats,and in one SS format, the contents of the general register designated bythe B4 field are added to the contents of the D4 field to form thefourth-operand address.

In the SS format with a single, eight-bit length field, for theinstructions AND (NC), EXCLUSIVE OR (XC), MOVE (MVC), MOVE NUMERICS,MOVE ZONES, and OR (OC), L specifies the number of additional operandbytes to the right of the byte designated by the first-operand address.Therefore, the length in bytes of the first operand is 1-256,corresponding to a length code in L of 0-255. Storage results replacethe first operand and are never stored outside the field specified bythe address and length. In this format, the second operand has the samelength as the first operand. There are variations of the precedingdefinition that apply to EDIT, EDIT AND MARK, PACK ASCII, PACK UNICODE,TRANSLATE, TRANSLATE AND TEST, UNPACK ASCII, and UNPACK UNICODE.

In the SS format with two length fields, and in the RSL format, L1specifies the number of additional operand bytes to the right of thebyte designated by the first-operand address. Therefore, the length inbytes of the first operand is 1-16, corresponding to a length code in L1of 0-15. Similarly, L2 specifies the number of additional operand bytesto the right of the location designated by the second-operand addressResults replace the first operand and are never stored outside the fieldspecified by the address and length. If the first operand is longer thanthe second, the second operand is extended on the left with zeros up tothe length of the first operand. This extension does not modify thesecond operand in storage. In the SS format with two R fields, as usedby the MOVE TO PRIMARY, MOVE TO SECONDARY, and MOVE WITH KEYinstructions, the contents of the general register specified by the R1field are a 32-bit unsigned value called the true length. The operandsare both of a length called the effective length. The effective lengthis equal to the true length or 256, whichever is less. The instructionsset the condition code to facilitate programming a loop to move thetotal number of bytes specified by the true length. The SS format withtwo R fields is also used to specify a range of registers and twostorage operands for the LOAD MULTIPLE DISJOINT instruction and tospecify one or two registers and one or two storage operands for thePERFORM LOCKED OPERATION instruction.

A zero in any of the B1, B2, X2, or B4 fields indicates the absence ofthe corresponding address component. For the absent component, a zero isused informing the intermediate sum, regardless of the contents ofgeneral register 0. A displacement of zero has no special significance.

Bits 31 and 32 of the current PSW are the addressing-mode bits. Bit 31is the extended-addressing mode bit, and bit 32 is thebasic-addressing-mode bit. These bits control the size of the effectiveaddress produced by address generation. When bits 31 and 32 of thecurrent PSW both are zeros, the CPU is in the 24-bit addressing mode,and 24-bit instruction and operand effective addresses are generated.When bit 31 of the current PSW is zero and bit 32 is one, the CPU is inthe 31-bit addressing mode, and 31-bit instruction and operand effectiveaddresses are generated. When bits 31 and 32 of the current PSW are bothone, the CPU is in the 64-bit addressing mode, and 64-bit instructionand operand effective addresses are generated. Execution of instructionsby the CPU involves generation of the addresses of instructions andoperands.

When an instruction is fetched from the location designated by thecurrent PSW, the instruction address is increased by the number of bytesin the instruction, and the instruction is executed. The same steps arethen repeated by using the new value of the instruction address to fetchthe next instruction in the sequence. In the 24-bit addressing mode,instruction addresses wrap around, with the halfword at instructionaddress 2²⁴-2 being followed by the halfword at instruction address 0.Thus, in the 24-bit addressing mode, any carry out of PSW bit position104, as a result of updating the instruction address, is lost. In the31-bit or 64-bit addressing mode, instruction addresses similarly wraparound, with the halfword at instruction address 2³¹-2 or 2⁶⁴-2,respectively, followed by the halfword at instruction address 0. A carryout of PSW bit position 97 or 64, respectively, is lost.

An operand address that refers to storage is derived from anintermediate value, which either is contained in a register designatedby an R field in the instruction or is calculated from the sum of threebinary numbers: base address, index, and displacement. The base address(B) is a 64-bit number contained in a general register specified by theprogram in a four bit field, called the B field, in the instruction.Base addresses can be used as a means of independently addressing eachprogram and data area. In array type calculations, it can designate thelocation of an array, and, in record-type processing, it can identifythe record. The base address provides for addressing the entire storage.The base address may also be used for indexing.

The index (X) is a 64-bit number contained in a general registerdesignated by the program in a four-bit field, called the X field, inthe instruction. It is included only in the address specified by theRX-, RXE-, and RXY-format instructions. The RX-, RXE-, RXF-, andRXY-format instructions permit double indexing; that is, the index canbe used to provide the address of an element within an array.

The displacement (D) is a 12-bit or 20-bit number contained in a field,called the D field, in the instruction. A 12-bit displacement isunsigned and provides for relative addressing of up to 4,095 bytesbeyond the location designated by the base address. A 20-bitdisplacement is signed and provides for relative addressing of up to524,287 bytes beyond the base address location or of up to 524,288 bytesbefore it. In array-type calculations, the displacement can be used tospecify one of many items associated with an element. In the processingof records, the displacement can be used to identify items within arecord. A 12-bit displacement is in bit positions 20-31 of instructionsof certain formats. In instructions of some formats, a second 12-bitdisplacement also is in the instruction, in bit positions 36-47.

A 20-bit displacement is in instructions of only the RSY, RXY, or SIYformat. In these instructions, the D field consists of a DL (low) fieldin bit positions 20-31 and of a DH (high) field in bit positions 32-39.When the long-displacement facility is installed, the numeric value ofthe displacement is formed by appending the contents of the DH field onthe left of the contents of the DL field. When the long-displacementfacility is not installed, the numeric value of the displacement isformed by appending eight zero bits on the left of the contents of theDL field, and the contents of the DH field are ignored.

In forming the intermediate sum, the base address and index are treatedas 64-bit binary integers. A 12-bit displacement is treated as a 12-bitunsigned binary integer, and 52 zero bits are appended on the left. A20-bit displacement is treated as a 20-bit signed binary integer, and 44bits equal to the sign bit are appended on the left. The three are addedas 64-bit binary numbers, ignoring overflow. The sum is always 64 bitslong and is used as an intermediate value to form the generated address.The bits of the intermediate value are numbered 0-63. A zero in any ofthe B1, B2, X2, or B4 fields indicates the absence of the correspondingaddress component. For the absent component, a zero is used in formingthe intermediate sum, regardless of the contents of general register 0.A displacement of zero has no special significance.

When an instruction description specifies that the contents of a generalregister designated by an R field are used to address an operand instorage, the register contents are used as the 64-bit intermediatevalue.

An instruction can designate the same general register both for addresscomputation and as the location of an operand. Address computation iscompleted before registers, if any, are changed by the operation. Unlessotherwise indicated in an individual instruction definition, thegenerated operand address designates the leftmost byte of an operand instorage.

The generated operand address is always 64 bits long, and the bits arenumbered 0-63. The manner in which the generated address is obtainedfrom the intermediate value depends on the current addressing mode. Inthe 24-bit addressing mode, bits 0-39 of the intermediate value areignored, bits 0-39 of the generated address are forced to be zeros, andbits 40-63 of the intermediate value become bits 40-63 of the generatedaddress. In the 31-bit addressing mode, bits 0-32 of the intermediatevalue are ignored, bits 0-32 of the generated address are forced to bezero, and bits 33-63 of the intermediate value become bits 33-63 of thegenerated address. In the 64-bit addressing mode, bits 0-63 of theintermediate value become bits 0-63 of the generated address. Negativevalues may be used in index and base-address registers. Bits 0-32 ofthese values are ignored in the 31-bit addressing mode, and bits 0-39are ignored in the 24-bit addressing mode.

For branch instructions, the address of the next instruction to beexecuted when the branch is taken is called the branch address.Depending on the branch instruction, the instruction format may be RR,RRE, RX, RXY, RS, RSY, RSI, RI, RIE, or RIL. In the RS, RSY, RX, and RXYformats, the branch address is specified by a base address, adisplacement, and, in the RX and RXY formats, an index. In theseformats, the generation of the intermediate value follows the same rulesas for the generation of the operand-address intermediate value. In theRR and RRE formats, the contents of the general register designated bythe R2 field are used as the intermediate value from which the branchaddress is formed. General register 0 cannot be designated as containinga branch address. A value of zero in the R2 field causes the instructionto be executed without branching.

The relative-branch instructions are in the RSI, RI, RIE, and RILformats. In the RSI, RI, and RIE formats for the relative-branchinstructions, the contents of the I2 field are treated as a 16-bitsigned binary integer designating a number of halfwords. In the RILformat, the contents of the I2 field are treated as a 32-bit signedbinary integer designating a number of halfwords. The branch address isthe number of halfwords designated by the I2 field added to the addressof the relative-branch instruction.

The 64-bit intermediate value for a relative branch instruction in theRSI, RI, RIE, or RIL format is the sum of two addends, with overflowfrom bit position 0 ignored. In the RSI, RI, or RIE format, the firstaddend is the contents of the I2 field with one zero bit appended on theright and 47 bits equal to the sign bit of the contents appended on theleft, except that for COMPARE AND BRANCH RELATIVE, COMPARE IMMEDIATE ANDBRANCH RELATIVE, COMPARE LOGICAL AND BRANCH RELATIVE and COMPARE LOGICALIMMEDIATE AND BRANCH RELATIVE, the first addend is the contents of theI4 field, with bits appended as described above for the I2 field. In theRIL format, the first addend is the contents of the I2 field with onezero bit appended on the right and 31 bits equal to the sign bit of thecontents appended on the left. In all formats, the second addend is the64-bit address of the branch instruction. The address of the branchinstruction is the instruction address in the PSW before that address isupdated to address the next sequential instruction, or it is the addressof the target of the EXECUTE instruction if EXECUTE is used. If EXECUTEis used in the 24-bit or 31-bit addressing mode, the address of thebranch instruction is the target address with 40 or 33 zeros,respectively, appended on the left.

The branch address is always 64 bits long, with the bits numbered 0-63.The branch address replaces bits 64-127 of the current PSW. The mannerin which the branch address is obtained from the intermediate valuedepends on the addressing mode. For those branch instructions whichchange the addressing mode, the new addressing mode is used. In the24-bit addressing mode, bits 0-39 of the intermediate value are ignored,bits 0-39 of the branch address are made zeros, and bits 40-63 of theintermediate value become bits 40-63 of the branch address. In the31-bit addressing mode, bits 0-32 of the intermediate value are ignored,bits 0-32 of the branch address are made zeros, and bits 33-63 of theintermediate value become bits 33-63 of the branch address. In the64-bit addressing mode, bits 0-63 of the intermediate value become bits0-63 of the branch address.

For several branch instructions, branching depends on satisfying aspecified condition. When the condition is not satisfied, the branch isnot taken, normal sequential instruction execution continues, and thebranch address is not used. When a branch is taken, bits 0-63 of thebranch address replace bits 64-127 of the current PSW. The branchaddress is not used to access storage as part of the branch operation. Aspecification exception due to an odd branch address and accessexceptions due to fetching of the instruction at the branch location arenot recognized as part of the branch operation but instead arerecognized as exceptions associated with the execution of theinstruction at the branch location.

A branch instruction, such as BRANCH AND SAVE, can designate the samegeneral register for branch address computation and as the location ofan operand. Branch-address computation is completed before the remainderof the operation is performed.

The program-status word (PSW), described in Chapter 4 “Control” containsinformation required for proper program execution. The PSW is used tocontrol instruction sequencing and to hold and indicate the status ofthe CPU in relation to the program currently being executed. The activeor controlling PSW is called the current PSW. Branch instructionsperform the functions of decision making, loop control, and subroutinelinkage. A branch instruction affects instruction sequencing byintroducing a new instruction address into the current PSW. Therelative-branch instructions with a 16-bit I2 field allow branching to alocation at an offset of up to plus 64K—2 bytes or minus 64K bytesrelative to the location of the branch instruction, without the use of abase register. The relative-branch instructions with a 32-bit I2 fieldallow branching to a location at an offset of up to plus 4G—2 bytes orminus 4G bytes relative to the location of the branch instruction,without the use of a base register.

Facilities for decision making are provided by the BRANCH ON CONDITION,BRANCH RELATIVE ON CONDITION, and BRANCH RELATIVE ON CONDITION LONGinstructions. These instructions inspect a condition code that reflectsthe result of a majority of the arithmetic, logical, and I/O operations.The condition code, which consists of two bits, provides for fourpossible condition-code settings: 0, 1, 2, and 3.

The specific meaning of any setting depends on the operation that setsthe condition code. For example, the condition code reflects suchconditions as zero, nonzero, first operand high, equal, overflow, andsubchannel busy. Once set, the condition code remains unchanged untilmodified by an instruction that causes a different condition code to beset.

Loop control can be performed by the use of BRANCH ON CONDITION, BRANCHRELATIVE ON CONDITION, and BRANCH RELATIVE ON CONDITION LONG to test theoutcome of address arithmetic and counting operations. For someparticularly frequent combinations of arithmetic and tests, BRANCH ONCOUNT, BRANCH ON INDEX HIGH, and BRANCH ON INDEX LOW OR EQUAL areprovided, and relative-branch equivalents of these instructions are alsoprovided. These branches, being specialized, provide increasedperformance for these tasks.

Subroutine linkage when a change of the addressing mode is not requiredis provided by the BRANCH AND LINK and BRANCH AND SAVE instructions.(This discussion of BRANCH AND SAVE applies also to BRANCH RELATIVE ANDSAVE and BRANCH RELATIVE AND SAVE LONG.) Both of these instructionspermit not only the introduction of a new instruction address but alsothe preservation of a return address and associated information. Thereturn address is the address of the instruction following the branchinstruction in storage, except that it is the address of the instructionfollowing an EXECUTE instruction that has the branch instruction as itstarget.

Both BRANCH AND LINK and BRANCH AND SAVE have an R1 field. They form abranch address by means of fields that depend on the instruction. Theoperations of the instructions are summarized as follows: • In the24-bit addressing mode, both instructions place the return address inbit positions 40-63 of general register R1 and leave bits 0-31 of thatregister unchanged. BRANCH AND LINK places the instruction-length codefor the instruction and also the condition code and program mask fromthe current PSW in bit positions 32-39 of general register R1 BRANCH ANDSAVE places zeros in those bit positions.

In the 31-bit addressing mode, both instructions place the returnaddress in bit positions 33-63 and a one in bit position 32 of generalregister R1, and they leave bits 0-31 of the register unchanged.In the 64-bit addressing mode, both instructions place the returnaddress in bit positions 0-63 of general register R1.In any addressing mode, both instructions generate the branch addressunder the control of the current addressing mode. The instructions placebits 0-63 of the branch address in bit positions 64-127 of the PSW. Inthe RR format, both instructions do not perform branching if the R2field of the instruction is zero.

It can be seen that, in the 24-bit or 31-bit addressing mode, BRANCH ANDSAVE places the basic addressing-mode bit, bit 32 of the PSW, in bitposition 32 of general register R1. BRANCH AND LINK does so in the31-bit addressing mode. The instructions BRANCH AND SAVE AND SET MODEand BRANCH AND SET MODE are for use when a change of the addressing modeis required during linkage. These instructions have R1 and R2 fields.The operations of the instructions are summarized as follows:

BRANCH AND SAVE AND SET MODE sets the contents of general register R1the same as BRANCH AND SAVE. In addition, the instruction places theextended-addressing-mode bit, bit 31 of the PSW, in bit position 63 ofthe register.BRANCH AND SET MODE, if R1 is nonzero, performs as follows. In the 24-or 31-bit mode, it places bit 32 of the PSW in bit position 32 ofgeneral register R1, and it leaves bits 0-31 and 33-63 of the registerunchanged. Note that bit 63 of the register should be zero if theregister contains an instruction address. In the 64-bit mode, theinstruction places bit 31 of the PSW (a one) in bit position 63 ofgeneral register R1, and it leaves bits 0-62 of the register unchanged.When R2 is nonzero, both instructions set the addressing mode andperform branching as follows. Bit 63 of general register R2 is placed inbit position 31 of the PSW. If bit 63 is zero, bit 32 of the register isplaced in bit position 32 of the PSW. If bit 63 is one, PSW bit 32 isset to one. Then the branch address is generated from the contents ofthe register, except with bit 63 of the register treated as a zero,under the control of the new addressing mode. The instructions placebits 0-63 of the branch address in bit positions 64-127 of the PSW. Bit63 of general register R2 remains unchanged and, therefore, may be oneupon entry to the called program. If R2 is the same as R1, the resultsin the designated general register are as specified for the R1 register.

Interruptions (Context Switch):

The interruption mechanism permits the CPU to change its state as aresult of conditions external to the configuration, within theconfiguration, or within the CPU itself. To permit fast response toconditions of high priority and immediate recognition of the type ofcondition, interruption conditions are grouped into six classes:external, input/output, machine check, program, restart, and supervisorcall.

An interruption consists in storing the current PSW as an old PSW,storing information identifying the cause of the interruption, andfetching a new PSW. Processing resumes as specified by the new PSW. Theold PSW stored on an interruption normally contains the address of theinstruction that would have been executed next had the interruption notoccurred, thus permitting resumption of the interrupted program. Forprogram and supervisor-call interruptions, the information stored alsocontains a code that identifies the length of the last-executedinstruction, thus permitting the program to respond to the cause of theinterruption. In the case of some program conditions for which thenormal response is re-execution of the instruction causing theinterruption, the instruction address directly identifies theinstruction last executed.

Except for restart, an interruption can occur only when the CPU is inthe operating state. The restart interruption can occur with the CPU ineither the stopped or operating state.

Any access exception is recognized as part of the execution of theinstruction with which the exception is associated. An access exceptionis not recognized when the CPU attempts to prefetch from an unavailablelocation or detects some other access-exception condition, but a branchinstruction or an interruption changes the instruction sequence suchthat the instruction is not executed. Every instruction can cause anaccess exception to be recognized because of instruction fetch.Additionally, access exceptions associated with instruction executionmay occur because of an access to an operand in storage. An accessexception due to fetching an instruction is indicated when the firstinstruction halfword cannot be fetched without encountering theexception. When the first halfword of the instruction has no accessexceptions, access exceptions may be indicated for additional halfwordsaccording to the instruction length specified by the first two bits ofthe instruction; however, when the operation can be performed withoutaccessing the second or third halfwords of the instruction, it isunpredictable whether the access exception is indicated for the unusedpart. Since the indication of access exceptions for instruction fetch iscommon to all instructions, it is not covered in the individualinstruction definitions.

Except where otherwise indicated in the individual instructiondescription, the following rules apply for exceptions associated with anaccess to an operand location. For a fetch-type operand, accessexceptions are necessarily indicated only for that portion of theoperand which is required for completing the operation. It isunpredictable whether access exceptions are indicated for those portionsof a fetch-type operand which are not required for completing theoperation.

For a store-type operand, access exceptions are recognized for theentire operand even if the operation could be completed without the useof the inaccessible part of the operand. In situations where the valueof a store-type operand is defined to be unpredictable, it isunpredictable whether an access exception is indicated. Whenever anaccess to an operand location can cause an access exception to berecognized, the word “access” is included in the list of programexceptions in the description of the instruction. This entry alsoindicates which operand can cause the exception to be recognized andwhether the exception is recognized on a fetch or store access to thatoperand location. Access exceptions are recognized only for the portionof the operand as defined for each particular instruction.

An operation exception is recognized when the CPU attempts to execute aninstruction with an invalid operation code. The operation code may beunassigned, or the instruction with that operation code may not beinstalled on the CPU. The operation is suppressed. Theinstruction-length code is 1, 2, or 3. The operation exception isindicated by a program interruption code of 0001 hex (or 0081 hex if aconcurrent PER event is indicated).

Some models may offer instructions not described in this publication,such as those provided for assists or as part of special or customfeatures. Consequently, operation codes not described in thispublication do not necessarily cause an operation exception to berecognized. Furthermore, these instructions may cause modes of operationto be set up or may otherwise alter the machine so as to affect theexecution of subsequent instructions. To avoid causing such anoperation, an instruction with an operation code not described in thispublication should be executed only when the specific functionassociated with the operation code is desired.

A specification exception is recognized when any of the following istrue:

1. A one is introduced into an unassigned bit position of the PSW (thatis, any of bit positions 0, 2-4, 24-30, or 33-63). This is handled as anearly PSW specification exception.2. A one is introduced into bit position 12 of the PSW. This is handledas an early PSW specification exception.3. The PSW is invalid in any of the following ways: a. Bit 31 of the PSWis one and bit 32 is zero. b. Bits 31 and 32 of the PSW are zero,indicating the 24-bit addressing mode, and bits 64-103 of the PSW arenot all zeros. c. Bit 31 of the PSW is zero and bit 32 is one,indicating the 31-bit addressing mode, and bits 64-96 of the PSW are notall zeros. This is handled as an early PSW specification exception.4. The PSW contains an odd instruction address.5. An operand address does not designate an integral boundary in aninstruction requiring such integral-boundary designation.6. An odd-numbered general register is designated by an R field of aninstruction that requires an even-numbered register designation.7. A floating-point register other than 0, 1, 4, 5, 8, 9, 12, or 13 isdesignated for an extended operand.8. The multiplier or divisor in decimal arithmetic exceeds 15 digits andsign.9. The length of the first-operand field is less than or equal to thelength of the second-operand field in decimal multiplication ordivision.10. Execution of CIPHER MESSAGE, CIPHER MESSAGE WITH CHAINING, COMPUTEINTERMEDIATE MESSAGE DIGEST, COMPUTE LAST MESSAGE DIGEST, or COMPUTEMESSAGE AUTHENTICATION CODE is attempted, and the function code in bits57-63 of general register 0 contain an unassigned or uninstalledfunction code.11. Execution of CIPHER MESSAGE or CIPHER MESSAGE WITH CHAINING isattempted, and the R1 or R2 field designates an odd-numbered register orgeneral register 0.12. Execution of CIPHER MESSAGE, CIPHER MESSAGE WITH CHAINING, COMPUTEINTERMEDIATE MESSAGE DIGEST or COMPUTE MESSAGE AUTHENTICATION CODE isattempted, and the second operand length is not a multiple of the datablock size of the designated function. This specification-exceptioncondition does not apply to the query functions.13. Execution of COMPARE AND FORM CODEWORD is attempted, and generalregisters 1, 2, and 3 do not initially contain even values.32. Execution of COMPARE AND SWAP AND STORE is attempted and any of thefollowing conditions exist:

The function code specifies an unassigned value.

The store characteristic specifies an unassigned value.

The function code is 0, and the first operand is not designated on aword boundary.

The function code is 1, and the first operand is not designated on adoubleword boundary.

The second operand is not designated on an integral boundarycorresponding to the size of the store value.

33. Execution of COMPARE LOGICAL LONG UNICODE or MOVE LONG UNICODE isattempted, and the contents of either general register R1+1 or R3+1 donot specify an even number of bytes.34. Execution of COMPARE LOGICAL STRING, MOVE STRING or SEARCH STRING isattempted, and bits 32-55 of general register 0 are not all zeros.35. Execution of COMPRESSION CALL is attempted, and bits 48-51 ofgeneral register 0 have any of the values 0000 and 0110-1111 binary.36. Execution of COMPUTE INTERMEDIATE MESSAGE DIGEST, COMPUTE LASTMESSAGE DIGEST, or COMPUTE MESSAGE AUTHENTICATION CODE is attempted, andeither of the following is true:

The R2 field designates an odd-numbered register or general register 0.

Bit 56 of general register 0 is not zero.

37. Execution of CONVERT HFP TO BFP, CONVERT TO FIXED (BFP or HFP), orLOAD FP INTEGER (BFP) is attempted, and the M3 field does not designatea valid modifier.38. Execution of DIVIDE TO INTEGER is attempted, and the M4 field doesnot designate a valid modifier.39. Execution of EXECUTE is attempted, and the target address is odd.40. Execution of EXTRACT STACKED STATE is attempted, and the code in bitpositions 56-63 of general register R2 is greater than 4 when theASN-and-LX-reuse facility is not installed or is greater than 5 when thefacility is installed.41. Execution of FIND LEFTMOST ONE is attempted, and the R1 fielddesignates an oddnumbered register.42. Execution of INVALIDATE DAT TABLE ENTRY is attempted, and bits 44-51of general register R2 are not all zeros.43. Execution of LOAD FPC is attempted, and one or more bits of thesecond operand corresponding to unsupported bits in the FPC register areone.44. Execution of LOAD PAGE-TABLE-ENTRY ADDRESS is attempted and the M4field of the instruction contains any value other than 0000-0100 binary.45. Execution of LOAD PSW is attempted and bit 12 of the doubleword atthe second-operand address is zero. It is model dependent whether or notthis exception is recognized.46. Execution of MONITOR CALL is attempted, and bit positions 8-11 ofthe instruction do not contain zeros.47. Execution of MOVE PAGE is attempted, and bit positions 48-51 ofgeneral register 0 do not contain zeros or bits 52 and 53 of theregister are both one.48. Execution of PACK ASCII is attempted, and the L2 field is greaterthan 31.49. Execution of PACK UNICODE is attempted, and the L2 field is greaterthan 63 or is even.50. Execution of PERFORM FLOATING POINT OPERATION is attempted, bit 32of general register 0 is zero, and one or more fields in bits 33-63 areinvalid or designate an uninstalled function.51. Execution of PERFORM LOCKED OPERATION is attempted, and any of thefollowing is true: • The T bit, bit 55 of general register 0 is zero,and the function code in bits 56-63 of the register is invalid. • Bits32-54 of general register 0 are not all zeros. • In the access-registermode, for function codes that cause use of a parameter list containingan ALET, the R3 field is zero.52. Execution of PERFORM TIMING FACILITY FUNCTION is attempted, andeither of the following is true: • Bit 56 of general register 0 is notzero. • Bits 57-63 of general register 0 specify an unassigned oruninstalled function code.53. Execution of PROGRAM TRANSFER or PROGRAM TRANSFER WITH INSTANCE isattempted, and all of the following are true: • Theextended-addressing-mode bit in the PSW is zero. • Thebasic-addressing-mode bit, bit 32, in the general register designated bythe R2 field of the instruction is zero. • Bits 33-39 of the instructionaddress in the same register are not all zeros.

54. Execution of RESUME PROGRAM is attempted, and either of thefollowing is true:

Bits 31, 32, and 64-127 of the PSW field in the second operand are notvalid for placement in the current PSW. The exception is recognized ifany of the following is true:

Bits 31 and 32 are both zero and bits 64-103 are not all zeros. —Bits 31and 32 are zero and one, respectively, and bits 64-96 are not all zeros.—Bits 31 and 32 are one and zero, respectively. —Bit 127 is one.

Bits 0-12 of the parameter list are not all zeros.

55. Execution of SEARCH STRING UNICODE is attempted, and bits 32-47 ofgeneral register 0 are not all zeros.56. Execution of SET ADDRESS SPACE CONTROL or SET ADDRESS SPACE CONTROLFAST is attempted, and bits 52 and 53 of the second-operand address arenot both zeros.57. Execution of SET ADDRESSING MODE (SAM24) is attempted, and bits 0-39of the un-updated instruction address in the PSW, bits 64-103 of thePSW, are not all zeros.58. Execution of SET ADDRESSING MODE (SAM31) is attempted, and bits 0-32of the un-updated instruction address in the PSW, bits 64-96 of the PSW,are not all zeros.59. Execution of SET CLOCK PROGRAMMABLE FIELD is attempted, and bits32-47 of general register 0 are not all zeros.60. Execution of SET FPC is attempted, and one or more bits of the firstoperand corresponding to unsupported bits in the FPC register are one.61. Execution of STORE SYSTEM INFORMATION is attempted, the functioncode in general register 0 is valid, and either of the following istrue: • Bits 36-55 of general register 0 and bits 32-47 of generalregister 1 are not all zeros. • The second-operand address is notaligned on a 4K-byte boundary.62. Execution of TRANSLATE TWO TO ONE or TRANSLATE TWO TO TWO isattempted, and the length in general register R1+1 does not specify aneven number of bytes.63. Execution of UNPACK ASCII is attempted, and the L1 field is greaterthan 31.64. Execution of UNPACK UNICODE is attempted, and the L1 field isgreater than 63 or is even.65. Execution of UPDATE TREE is attempted, and the initial contents ofgeneral registers 4 and 5 are not a multiple of 8 in the 24-bit or31-bit addressing mode or are not a multiple of 16 in the 64-bitaddressing mode. The execution of the instruction identified by the oldPSW is suppressed. However, for early PSW specification exceptions(causes 1-3) the operation that introduces the new PSW is completed, butan interruption occurs immediately thereafter. Preferably, theinstruction-length code (ILC) is 1, 2, or 3, indicating the length ofthe instruction causing the exception. When the instruction address isodd (cause 4 on page 6-33), it is unpredictable whether the ILC is 1, 2,or 3. When the exception is recognized because of an early PSWspecification exception (causes 1-3) and the exception has beenintroduced by LOAD PSW, LOAD PSW EXTENDED, PROGRAM RETURN, or aninterruption, the ILC is 0. When the exception is introduced by SETADDRESSING MODE (SAM24, SAM31), the ILC is 1, or it is 2 if SETADDRESSING MODE was the target of EXECUTE. When the exception isintroduced by SET SYSTEM MASK or by STORE THEN OR SYSTEM MASK, the ILCis 2.

Program interruptions are used to report exceptions and events whichoccur during execution of the program. A program interruption causes theold PSW to be stored at real locations 336-351 and a new PSW to befetched from real locations 464-479. The cause of the interruption isidentified by the interruption code. The interruption code is placed atreal locations 142-143, the instruction-length code is placed in bitpositions 5 and 6 of the byte at real location 141 with the rest of thebits set to zeros, and zeros are stored at real location 140. For somecauses, additional information identifying the reason for theinterruption is stored at real locations 144-183. If the PER-3 facilityis installed, then, as part of the program interruption action, thecontents of the breaking-event-address register are placed in realstorage locations 272-279. Except for PER events and thecrypto-operation exception, the condition causing the interruption isindicated by a coded value placed in the rightmost seven bit positionsof the interruption code. Only one condition at a time can be indicated.Bits 0-7 of the interruption code are set to zeros. PER events areindicated by setting bit 8 of the interruption code to one. When this isthe only condition, bits 0-7 and 9-15 are also set to zeros. When a PERevent is indicated concurrently with another program interruptioncondition, bit 8 is one, and bits 0-7 and 9-15 are set as for the othercondition. The crypto-operation exception is indicated by aninterruption code of 0119 hex, or 0199 hex if a PER event is alsoindicated.

When there is a corresponding mask bit, a program interruption can occuronly when that mask bit is one. The program mask in the PSW controlsfour of the exceptions, the IEEE masks in the FPC register control theIEEE exceptions, bit 33 in control register 0 controls whether SETSYSTEM MASK causes a special-operation exception, bits 48-63 in controlregister 8 control interruptions due to monitor events, and a hierarchyof masks control interruptions due to PER events. When any controllingmask bit is zero, the condition is ignored; the condition does notremain pending.

When the new PSW for a program interruption has a PSW-format error orcauses an exception to be recognized in the process of instructionfetching, a string of program interruptions may occur.

Some of the conditions indicated as program exceptions may be recognizedalso by the channel subsystem, in which case the exception is indicatedin the subchannel-status word or extended-status word.

When a data exception causes a program interruption, a data-exceptioncode (DXC) is stored at location 147, and zeros are stored at locations144-146. The DXC distinguishes between the various types ofdata-exception conditions. When the AFP-register (additionalfloating-point register) control bit, bit 45 of control register 0, isone, the DXC is also placed in the DXC field of thefloating-point-control (FPC) register. The DXC field in the FPC registerremains unchanged when any other program exception is reported. The DXCis an 8-bit code indicating the specific cause of a data exception.

DXC 2 and 3 are mutually exclusive and are of higher priority than anyother DXC. Thus, for example, DXC 2 (BFP instruction) takes precedenceover any IEEE exception; and DXC 3 (DFP instruction) takes precedenceover any IEEE exception or simulated IEEE exception. As another example,if the conditions for both DXC 3 (DFP instruction) and DXC 1 (AFPregister) exist, DXC 3 is reported. When both a specification exceptionand an AFP register data exception apply, it is unpredictable which oneis reported.

An addressing exception is recognized when the CPU attempts to referencea main-storage location that is not available in the configuration. Amain-storage location is not available in the configuration when thelocation is not installed, when the storage unit is not in theconfiguration, or when power is off in the storage unit. An addressdesignating a storage location that is not available in theconfiguration is referred to as invalid. The operation is suppressedwhen the address of the instruction is invalid. Similarly, the operationis suppressed when the address of the target instruction of EXECUTE isinvalid. Also, the unit of operation is suppressed when an addressingexception is encountered in accessing a table or table entry. The tablesand table entries to which the rule applies are thedispatchable-unit-control table, the primary ASN second-table entry, andentries in the access list, region first table, region second table,region third table, segment table, page table, linkage table,linkage-first table, linkage-second table, entry table, ASN first table,ASN second table, authority table, linkage stack, and trace table.Addressing exceptions result in suppression when they are encounteredfor references to the region first table, region second table, regionthird table, segment table, and page table, in both implicit referencesfor dynamic address translation and references associated with theexecution of LOAD PAGE-TABLE-ENTRY ADDRESS, LOAD REAL ADDRESS, STOREREAL ADDRESS, and TEST PROTECTION. Similarly, addressing exceptions foraccesses to the dispatchable-unit control table, primaryASN-second-table entry, access list, ASN second table, or authoritytable result in suppression when they are encountered in access-registertranslation done either implicitly or as part of LOAD PAGE-TABLE-ENTRYADDRESS, LOAD REAL ADDRESS, STORE REAL ADDRESS, TEST ACCESS, or TESTPROTECTION. Except for some specific instructions whose execution issuppressed, the operation is terminated for an operand address that canbe translated but designates an unavailable location. For termination,changes may occur only to result fields. In this context, the term“result field” includes the condition code, registers, and any storagelocations that are provided and that are designated to be changed by theinstruction.

Execute Relative Long:

An Execute Relative Long instruction FIG. 6 having FIG. 7 708 an opcode,a register field specifying a register (R1) and an immediate field (I2)provides the ability to execute a single target instruction obtainedfrom a memory location relative to the address of the Execute RelativeLong instruction being executed (the program counter value of the PSW).Execute Relative Long is discussed in U.S. patent application Ser. No.11/972,714, filed Jan. 11, 2008, which patent application isincorporated by reference herein.

FIG. 7, when the Execute Relative instruction is fetched 701 from anaddress specified by the program counter of the processor executing theinstruction and executed, a target instruction is obtained 703 from antarget address preferably determined 702 by algebraically adding a signextended signed immediate value (I2) of the instruction to the currentprogram counter value. When the register (R1) field is not ‘0’ 704, bits8-15 of a copy of the single target instruction at the second-operandaddress is modified 705 by bits 56-63 of general register specified bythe R1 field of the instruction, and the resulting instruction, calledthe target instruction, is executed 706. When the register (R1) field is‘0’ 704, the copy of the single target instruction is executed 706without being modified.

After executing the single target instruction, the current programcounter is incremented by the size of the Execute Relative Longinstruction and the next sequential instruction following the ExecuteRelative Long instruction is fetched and executed (unless the executedinstruction is a branch, or unless there is an interruption).

In an embodiment FIG. 8, the target address of the single targetinstruction to be executed is determined by the opcode of theinstruction and is any one of:

obtained 801 from a second register specified by a second field of theinstruction;

obtained 802 from adding the program counter 804 to the value of secondregister 801 specified by a second field of the instruction, the programcounter obtained from a PSW 803;

obtained 805 from adding the program counter 804 to the value of secondregister 801 specified by a second field of the instruction, the programcounter obtained from a PSW 803 added to an immediate field (I2) of theinstruction; or obtained 806 from adding the program counter 804 to animmediate field (I2) of the instruction.

Preferably, when the R1 field is not zero, bits 8-15 of the instructiondesignated by the second-operand address are ORed with bits 56-63 ofgeneral register R1. The ORing does not change either the contents ofgeneral register R1 or the instruction in storage, and it is effectiveonly for the interpretation of the instruction to be executed. When theR1 field is zero, no ORing takes place.

The target instruction may be two, four, or six bytes in length asspecified by the opcode of the target instruction. The execution andexception handling of the target instruction are exactly as if thetarget instruction were obtained in normal sequential operation, exceptfor the instruction address and the instruction-length code. The EXECUTERELATIVE LONG instruction of the invention may co-exist with otherexecute-type instructions including the EXECUTE instruction of thez/Architecture.

The instruction address in the current PSW is increased by the length ofthe execute-type instruction (6 bytes for EXECUTE RELATIVE LONG), unlessthe executed instruction causes a branch to occur. If the targetinstruction does not specify a next instruction or a program interrupt,execution will continue, after the target instruction is executed, atthe instruction address following the Execute Relative Long instruction.This updated address and the instruction-length code of the execute-typeinstruction are used, for example, as part of the link information whenthe target instruction is BRANCH AND LINK. When the target instructionis a successful branching instruction, the instruction address in thecurrent PSW is replaced by the branch address specified by the targetinstruction. When the target instruction is in turn an execute-typeinstruction, an execute exception is recognized. The effective addressof EXECUTE must be even; otherwise, a specification exception isrecognized. When the target instruction is two or three halfwords inlength but can be executed without fetching its second or thirdhalfword, it is unpredictable whether access exceptions are recognizedfor the unused halfwords. Access exceptions are not recognized for thesecond-operand address when the address is odd. Preferably, an accessexception causes a context switch to the operating system exceptionhandler.

The second-operand address of an execute-type instruction is aninstruction address rather than a logical address; thus, the targetinstruction is fetched from the primary address space when in theprimary-space, secondary-space, or access-register mode as specified inthe z/Architecture Principles of Operation.

For EXECUTE RELATIVE LONG, the contents of the 32 bit I2 field are asigned binary integer (preferably sign extended 2's complement whennegative) specifying the number of halfwords that is added to the valueof the program counter (the address of the Execute Relative Longinstruction) to generate the address of the target instruction instorage. The value of the program counter specified by the PSW may beany of 24 bits, 31 bits or preferably 64 bits.

If the target instruction, when executed is architected to set conditioncodes, the condition codes will be set accordingly. Program exceptionsarchitected for the Execute Relative long instruction or the targetinstruction will cause the following program exceptions:

Access (fetch, target instruction)

Execute

Operation (EXRL, when the execute-extensions facility is not installed)

The ORing of eight bits from the general register with the designatedinstruction permits the indirect specification of the length, index,mask, immediate-data, register, or extended-opcode field. The fetchingof the target instruction is considered to be an instruction fetch forpurposes of program-event recording and for purposes of reporting accessexceptions. An access or specification exception may be caused byexecute-type instructions or by the target instruction, except thatexecution of the EXECUTE RELATIVE LONG does not cause a specificationexception. When an interruptible instruction is made the target of anexecute-type instruction, the program normally should not designate anyregister updated by the interruptible instruction as the R1, X2, or B2register for EXECUTE or R1 register for EXECUTE RELATIVE LONG.Otherwise, on resumption of execution after an interruption, or if theinstruction is refetched without an interruption, the updated values ofthese registers will be used in the execution of the execute-typeinstruction. Similarly, the program should normally not let thedestination field in storage of an interruptible instruction include thelocation of an execute-type instruction, since the new contents of thelocation may be interpreted when resuming execution.

Modify Next-Sequential-Instruction (MNSI) Instruction:

It would be desirable to provide a program with a way to dynamicallyprovide parameters to instructions to be executed. One way would be tostore the instruction to be executed when the parameters are known. Thiswould be disruptive to execution since processor pipelines would have tohandle changing instructions already fetched for execution. Dynamicallycontrolling instruction parameters may be useful for programs that arewritten that utilize variable length structures such as tables. Forexample, a program may wish to dynamically create a table of a certainlength or insert a value in a location within the table. The Executeinstructions of the z/Architecture Principles of Operations ISA from IBM(described above) are capable of modifying bits 8-15 of a fetched targetinstruction (located by information provided in the Execute instruction)and executing the modified fetched target instruction, however,subsequent to executing the modified fetched target instruction, programexecution continues at the instruction following the Execute instruction(the next-sequential-instruction (NSI). Thus, the use of the Executeinstruction disrupts the sequential execution of the processor, causingperformance degradation. If an Execute instruction specified the NSI asthe target instruction, the effect of executing a modified fetched NSIby the Execute instruction would be overridden by the subsequentexecution of the actual un-modified NSI when continuing the executionstream. Furthermore, the Execute is limited to only modifying apredetermined field (bits 8-15) of the target fetched instruction. In anenvironment program may wish to dynamically assign operands, assignimmediate field values (such as length field values), extend a range offacilities (such as general registers) beyond the ISA (instruction setarchitecture) limit or otherwise dynamically manipulate fields of aninstruction.

A Modify-next-sequential-instruction (MNSI) instruction provides asolution. Referring to FIG. 9, in an embodiment, aModify-next-sequential-instruction (MNSI) Instruction 903 is a prefixinstruction, prefixed to the next sequential instruction (NSI) 904 andextending the capability of the NSI 904. The NSI instruction is anyinstruction of a program that directly follows another instruction, ofthe program, in program order. In an embodiment, the MNSI instruction,when executed, modifies a fetched copy of the NSI for execution. Theactual NSI in storage may not be modified by the execution of the MNSIinstruction. Thus, a branch instruction, having the NSI instruction as atarget, that causes the same NSI to be executed without executing theMNSI instruction that precedes it, will execute the original NSI nomatter how many times the NSI had been previously executed afterexecution of the MNSI instruction.

In another embodiment, the MNSI instruction 903, when executed, modifiesthe actual NSI 904 in storage, to be executed, Thus, a branchinstruction that causes the same NSI to be executed without executingthe MNSI instruction that precedes it, will execute the NSI as modifiedby a previous execution of an MNSI instruction.

In one embodiment, the MNSI instruction specifies a field of the NSI tobe modified as well as a value to use in the modification. In anotherembodiment, the MNSI instruction specifies more than one field of theNSI to be modified, and respective values to use in the modification. Inyet another embodiment, sequential MNSI instructions provide acumulative modification of an NSI. For an example, in an embodiment thatdoes not recognize a MNSI as an NSI to be modified, a first MNSIfollowed by a second MNSI followed by a NSI in program order are asequence of 3 instructions. The first MNSI at address x provides a firstvalue and a first field to be modified in an NSI. The second MNSI ataddress x+1 provides a second value and a second field to be modified,The NSI at address x+2 is the first NSI that is not an MNSI encounteredin the string, and is fetched and the first field specified by the firstMNSI as well as the second field specified by the second MNSI aremodified in the fetched NSI. The modified fetched NSI is then executed.In an embodiment, no interruption (except a specification exception) ispermitted between executing an MNSI and an actual NSI (non-MNSI)instruction.

In one embodiment, the field of the NSI to be modified is implied byMNSI instruction, where the MNSI only modifies an architecture definedfield of the NSI. In one embodiment, the MNSI comprises a register fieldfor locating a general register containing the location within the NSIto be modified. In one embodiment, the MNSI implicitly identifies aregister containing the location within the NSI to be modified. Inanother embodiment, the MNSI includes one or more immediate fields foridentifying the location within the NSI to be modified. The one or moreimmediate fields may indicate which field of the NSI is to be modified,by, for example indicating a ‘1’ for a first register field, and a ‘2’for a second register field, or, in an embodiment, two immediate fieldsmay specify a range of bits of the NSI that are to be modified. Othermethods, known in the art, can be employed for specifying, by the MNSI,a field of the NSI to be modified.

In one embodiment, the value to be used to modify the NSI is implied,for example, the NSI has a 4 bit register field for identifying one of16 registers. In a machine that employed 32 registers, the MNSIinstruction could cause the NSI to alternately access the first 16 orthe second 16 of the 32 registers. Thus, the programmer places the MNSIbefore an NSI instruction to cause the NSI instruction to “bank switch”between the two halves of the 32 registers. In another embodiment, thevalue to be used in the modified NSI is provided by an immediate fieldof the MNSI instruction. In another embodiment, the value to be used isprovided by a register, implicitly or explicitly identified by the MNSIinstruction.

In an embodiment, the instruction set architecture (ISA) of anarchitecture can be extended by way of the MNSI instruction. Forexample, the MNSI may provide a larger immediate field value to thefetched NSI, than exists in the NSI of the ISA. Thus, a small (8 bit)length field (L) of an NSI may be modified by the MNSI prefixinstruction to be larger (6 bits) in length. Alternatively the small (8bit) L field of the NSI can be bank-switched by appending a high-order 8bits from the MNSI instruction to form a larger (16 bit) L field. Inanother embodiment, a small (4 bit) register field of the NSI addressingone of a small number (16) of registers could be modified orbank-switched (as in the L field) to form a larger (6 bit) registerfield, addressing one of a larger number (64) of registers of thefetched NSI.

Referring to FIG. 9, three sequential instructions are shown forexample. The instructions are located, in memory, by program counter(PC) addresses 901 and may be identified by a mnemonic 902. An MNSIinstruction 903 at program counter address X is followed by a first NSIinstruction at PC address X+1, which is followed by a second NSI at PCaddress X+2 in program order. The MNSI instruction 903 includes anOPCode 1 field and an NSI field specifier 912. The first NSI 904includes an OPCode 2 field and an NSI field 913. The second NSI includesan OPCode 3 field. In an embodiment, the execution 906 of the MNSIinstruction 903 modifies a field 913 of the copy NSI for execution byproviding a substitute value for the field 913. The field may beimplicitly or explicitly identified by the MNSI instruction 903. In oneembodiment, the MNSI instruction 903 includes an NSI specifier 912 thatidentifies a field 913 and value of the first NSI 904 to be modified(the NSI field 913). In one embodiment, the MNSI instruction 903specifies a range of bits of the NSI 904 as the field 913 to bemodified. In another embodiment, the MNSI instruction 903 specifies afield type as the field 913 of the NSI 904 (such as R1, register fieldidentifying a register “R” having a first operand “1”; or as R2,register field identifying a register “R” having a second operand “2”; Lfield, an immediate field specifying a length, displacement or indexvalue; and Opcode field, a mask field etc.). In another embodiment theMNSI instruction 903 may specify a field position (first field, secondfield or third field) of an NSI instruction 904 as the field 913 to bemodified. In another embodiment, the MNSI instruction specifies a sourceregister field.

In an example implementation, the MNSI instruction 903 is fetched forexecution, The MNSI 903 is executed 906. In execution, the NSI fieldspecifier 912 identifies 907 a field 913 and a value to be modified inthe first NSI 904. The field identifier and value are obtained 908 andused 910 in the NSI field 913 when executing the fetched NSI 904.Subsequent to executing the NSI, another NSI 905 is executed. In anembodiment, the field identifier 912 and value are saved 909 for use ina context switch operation (such that the NSI 904, when executed afterthe context switch, will be executed with the modified values).

Referring to FIG. 10, in an embodiment a processor fetches andeffectively executes three sequential instructions in program order. Theprogram order is an MNSI instruction at address x, first NSI at addressx+1 then a second NSI at address x+2. Of course, an out-of-ordersuperscalar processor may actually execute the three instructionsout-of-program-order but make the results appear as if the instructionswere executed in program order by register renaming, conflict resolutionand the like. In the case where the first NSI is a branch or jumpinstruction, the second NSI is not executed in program order.

The processor fetch unit fetches an MNSI instruction 903 and a first NSIinstruction 904 and a decode unit decodes 1001 the MNSI instruction 903and a first NSI 904, the first NSI having an NSI field 913. The NSIfield 913 of the fetched first NSI is modified 1002 based on theexecution of the MNSI 903 which is discarded (since its execution doesnot change architecture state of the machine). The modified first NSI isthen executed 1004 using the modified field. The second NSI is executedin program order. In an embodiment, the PC is incremented when executingeach of the MNSI and NSI instructions.

In an embodiment, a processor decode unit decodes 1005 the MNSIinstruction 903 and the first NSI 904. A dispatch unit dispatches 1006the first NSI 904 and MNSI instruction 903 as micro-ops. An executionexecutes the micro-ops 1007 generated by the MNSI and first NSI, themicro-ops performing the function of the modified first NSI. In anembodiment, the PC is incremented as if the MNSI and NSI instructionswere one large instruction, to point to a second NSI 905.

In an embodiment, the MNSI instruction 903 implicitly specifies a field913, for example a length field, or for another example, bit positionsof the NSI 904. In one example, an instruction set architecture (ISA)has instructions with a length field occurring in bit positions 8-15 butother instructions where 8-15 are not a length field, for example someother instructions have portions of opcode fields (OPCode 2, OPCode 3)in bits 8-15. In this case, if the MNSI instruction 903 specified bits8-15 of the first NSI 904 as the field 913 to be modified, and the firstNSI was structured to have opcode bits (OPCode 2) in bits 8-15, thefirst MNSI instruction would cause an error exception, however if thefirst NSI had a length field in bits 8-15, the copy of the first NSIwould be modified and executed.

In an embodiment, a code sequence comprises 3 sequential instructions,an MNSI instruction 903 that precedes a first NSI 904 followed by asecond NSI 905. A program counter points to the instruction to beexecuted in sequence.

In an embodiment, an interruption is not permitted between execution ofan MNSI instruction 903 and the first NSI 904. In another embodiment, aninterruption between an MNSI instruction 903 and the first NSI 904causes a context switch operation to save the modified copy of the firstNSI 904 to be executed and state information indicating the saved copyof the first NSI 904 is to be executed when returning to the interruptedinstruction stream. In an embodiment program exceptions are permittedbetween the MNSI instruction 903 and the first NSI 904 possibly withstate information indicating that the first NSI 904 was subject to anMNSI instruction prefix.

In an embodiment, the instructions being executed are defined for afirst instruction set architecture (ISA) being emulated by a processorof another ISA, where the execution is performed by one or more nativeinstructions of the another ISA.

In an embodiment, the first ISA is a variable length complex instructionset ISA having instructions of different length, for example,instructions being any of 2 bytes, 4 bytes or 6 bytes in length, whilethe another ISA is a RISC fixed length ISA having only 32 bit (4 byte)instructions.

In an embodiment, the MNSI instruction 903 specifies 912 a registerhaving the value to use in the first NSI 904. In another embodiment theMNSI instruction 903 specifies a register having a value identifying theNSI field 912 to be modified.

In an embodiment, an error exception is generated when the MNSIinstruction 903 specifies a protected field. For example, if the MNSIinstruction 903 specifies a field comprising Opcode bits of the NSI 904,an exception is generated. The exception may abort execution of thefirst NSI.

In an embodiment, the field 913 of the first NSI 904 is replaced by thevalue specified 912 by the MNSI instruction 903. In another embodiment,the value of the field 913 of the first NSI 904 is operated-on based onthe value provided by executing the MNSI 903, where the operation may bean arithmetic or logical operation, for example, an ADD, SUBTRACT,SHIFT, ROTATE or one of a logical OR, AND or EXCLUSIVE OR operation.

In an embodiment wherein the MNSI instruction 903 is a prefixinstruction, the MNSI instruction 903 and the NSI instruction 904 may becombined by the processor executing the instructions, to be executed asa single instruction. In one embodiment, an immediate value of the NSIinstruction 904 that is provided in a register by the MNSI instruction903 is represented as a direct register operand by the combinedinstruction where the MNSI prefix instruction and the NSI instructionare executed as a single instruction.

For example, in a non-limiting exemplary embodiment, an MNSI instruction903 providing a length field (L) to a move character (MVC) NSIinstruction 904, of the zArchitecture Principles of Opeation, as an NSIinstruction may be implemented by a single internal move instructioncapable of moving a dynamically specified variable number of bytes, or amillicode/microcode routine providing the capability to move adynamically specified variable number of bytes. The MVC NSI 8 bit Lfield is replaced (or appended) with an L field provided by the MNSIinstruction resulting in a 16 bit effective L field of the fetched MVCNSI. Thus, the ISA limit of the MVC instruction to move 256 bytes fromone location to another location in memory is extended to provide aneffective fetched MVC instruction having a 16 bit L field capable ofmoving up to 64K bytes from one location to another location in memory.

In another example, an MNSI or combined sequential MNSIs could cause theeffective modified MVC NSI to not only have a greater L field thanprovided by the ISA, but also could provide a bank-switch or extendedset of registers beyond the 16 provided by the ISA.

Millicode is code comprising instructions that are invisible to anapplication programmer for emulating execution of a millicodedinstruction of an instruction set architecture (ISA) Millicode isdifferent from firmware in that Millicode instructions are fetched frommemory and executed by the processor and are therefore similar toapplication programs except Millicode is transparent to a programmer. Inan example, Millicode comprises instructions of an ISA and specialinstructions, not part of the ISA Millicode is typically used to executecomplex instruction set computer (CISC) instructions. A program may notbe able to tell whether an instruction is being executed by Millicodeinstructions, microcode ops or hardware circuits. In an embodiment, MNSIand NSI pairs are executed in whole or in part by Millicode routines.

In an embodiment where emulation of an ISA is performed on a platform ofanother ISA, the MNSI instruction 903 and the NSI instruction 904 aretranslated to a single instruction in the another ISA. In anotherimplementation of the MNSI and NSI instruction in the another ISA, theMNSI and NSI instruction pair are implemented by a single instructionsequence, either implemented as an inline sequence of instructions, oras a subroutine.

Referring to FIG. 13, at the start 1300, an MNSI of an ISA is received1301 from Memory address x, and an NSI is received from memory addressx+1. An emulation routine is selected 1302 based on the MNSI and the NSIfor emulating the execution of the combined MNSI and NSI operation(s)using instructions of another ISA. If 1303 the NSI change specified bythe MNSI and NSI instructions is supported, the selected emulationroutine is executed 1304 and the PC is updated 1305 to continueexecution of the ISA instructions following the NSI. If 1303, the NSIchange is not supported, an exception event is triggered 1306.

In an embodiment, in a non-limiting exemplary embodiment, an MNSIinstruction providing a length to an MVC instruction as an NSIinstruction may be implemented by a single move instruction (or set ofprocessor micro-ops) capable of moving a dynamically specified variablenumber of bytes, or a millicode or emulation subroutine providing thecapability to move a dynamically specified variable number of bytes.

In an embodiment, an MNSI instruction can extend the range of aninstruction of an ISA. Referring to FIG. 11, at the start 1100, an MNSIinstruction 903 is received 1101 from Memory address X and an NSI 904from Memory address x+1. A determination 1102 is made from the receivedMNSI instruction of a field of the NSI to be modified. If 1104, the MNSIinstruction indicates the NSI field is an extended operand size, aninternal instruction(s) or (internal ops) is generated 1105 having anextended operand size. The internal instruction(s) are executed toperform the NSI function using the extended operand size. Thus, forexample, an NSI of an ISA has a 4 bit register field to address 16registers, the MNSI specifies a 6 bit register field, enabling the NSIto effectively address 64 registers.

In an embodiment, a test 1103 is performed to determine if the NSIextended operand field size is supported, and, if not, an exceptionevent 1107 is triggered.

In an embodiment, if 1104 the MNSI indicates the NSI field is not anExtended operand size, an internal instruction(s) is generated 1108 forexecuting the NSI having the modified field. The internal instruction(s)is executed 1106 to perform the NSI function.

In an embodiment, a prediction is made of an operand value to be used inthe NSI. Referring to FIG. 12, at the start 1200, an MNSI instruction isreceived 1201 from memory address x and an NSI from memory address x+1.A determination is made 1202 from the MNSI of a field of the NSI to bemodified. An operand is obtained 1203 using an operand predictor, forexample, the predictor might predict the operand is the same aspreviously used by an NSI having the same modification. An internalinstruction(s) is generated 1204 from the NSI and the predicted value.The internal instruction is speculatively executed 1205. The correctnessof the prediction is verified 1206 and the predictor is updated 1207based on the correctness. If 1208 the prediction was correct the NSI iscompleted 1209 and the PC is updated. If 1208 the prediction wasincorrect, the speculative execution results are discarded 1210, aninternal instruction(s) is generated 1211 using a corrected fieldsspecification, obtained from the MNSI. The internal instruction(s) isexecuted 1212, and the NSI is completed 1209 and the PC updated to pointto the instruction following the NSI.

In an embodiment, an MNSI instruction 903 has a parameter indicatingwhether to modify a non-compliant parameter to a limited field (e.g., bycomputing a modulo, signed saturating or unsigned saturating value) orto augment the semantics of an NSI 904 by enabling the NSI 904 with aparameter that is out of range with respect to the originalspecification of the instruction.

In yet another embodiment, two MNSI instructions are provided, onelimited to in-range values according to the ISA, and one providing theability to enable NSIs with out of range parameters, beyond the ISAcapability. In one embodiment, an MNSI instruction is equipped with theability to enable only a limited set of NSIs with an out of rangecapability.

In an embodiment, when the value needed to modify the NSI is notavailable at decode time, the modified NSI instruction uses a predictedvalue when executing. In one aspect of such embodiment, a predictioncheck is performed, and a recovery operation is initiated when amisprediction has been detected. The modified NSI instruction iscompleted when the correct value is confirmed.

In the preceding, the modified fetched NSI may not physically be a newNSI instruction having the modifications. The term is used herein tosimplify explanation of aspects of the invention. the modified fetchedNSI may be implemented as any one of a firmware routine, a softwareroutine, a plurality of micro-ops unique to the processor circuitry, ora new expanded form of the NSI as best suits the processor design.

In an embodiment, the fetched NSI instruction is not physically modifiedby the MNSI instruction instruction, but the MNSI instruction causes astate to be instantiated to cause the NSI to use the modified parameterprovided by the MNSI instruction in, for instance, a pipelined processorcircuit. Thus, for example, the new length field is provided to thepipeline with a tag associating it with the NSI, at the proper stage inthe pipeline the new length field is used in place of (or in additionto) the length field of the original NSI.

Therefore, referring to FIG. 14, in an embodiment in a computer system,an MNSI prefix machine instruction (PMI) is executed to modify an MNSIspecified register of the next sequential instruction following hte MNSIin program order. In an embodiment this is accomplished by fetching 1401at an address specified by a program counter a prefix machineinstruction and a first next sequential instruction (NSI), the prefixmachine instruction and the first NSI defined for a computerarchitecture, the first NSI directly following the prefix machineinstruction in program order; and executing 1402 the fetched prefixmachine instruction and first NSI, the executing comprising: a)modifying 1403 a field of the fetched first NSI based on a valuespecified by the prefix machine instruction to produce a modified firstNSI; and b) executing 1404 the modified first NSI; and c) incrementing1405 the program counter to point to a second NSI, the second NSIdirectly following the first NSI in program order; and executing 1406the second NSI.

In an embodiment 1407, the field of the first NSI consists of any one ofan immediate field, an index field or a length field.

In an embodiment, the prefix instruction further comprises a firstregister field, the modifying further comprises: obtaining 1408 thevalue from a register specified by the first register field; andreplacing 1409 the field of the fetched first NSI with a replacementvalue based on the value specified by the prefix machine instruction(PMI).

Referring to FIG. 15, in an embodiment, based on the first registerfield being any one of one or more first register field values, themodifying 1403 further comprises: obtaining 1501 the value from a loworder portion of the register specified by the first register field;performing 1502 any one of a logical OR, AND or EXCLUSIVE OR of thevalue with the field of the fetched first NSI to form the replacementvalue.

Referring to FIG. 16, in an embodiment, based on an opcode field of thefirst NSI comprising bits of the field of the fetched first NSI 1601,the fetched prefix machine instruction is executed and first NSI isaborted 1602 and an error condition is signaled 1603.

In an embodiment, based on information provided by the prefix machineinstruction, a location in the fetched first NSI of the field of thefetched first NSI is determined.

In an embodiment, the information is extracted 1605 from a registerspecified by the prefix machine instruction, the information definingthe location of the field of the first NSI.

In an embodiment, the field of the modified NSI is larger 1409 than thefield of the NSI wherein the field of the modified NSI comprises a valuegreater than any value supported by the field of the NSI.

A prefix instruction has advantages over an optional prefix appended toan instruction, which may only perform limited overrides of operandsizes, or address sizes, or branch hints for example. A prefixinstruction can specify a more complex modification of the nextsequential instruction using the contents of a general purpose registerto replace fields in the next sequential instruction for example. Thisallows the runtime loading of the general purpose register which makesthe modification dynamic by the program to any of many differentpossibilities. If a move instruction is next sequential instruction thenit could have its length set to any length dynamically determined by aprogram whereas normally the length must be determined at latest atcompile time. Furthermore, a prefix instruction can be implemented usingan instruction length already used in the ISA. Thus, the hardware neednot provide for a new length of instruction to implement new features.For example, in the zArchitecture Principles of Operation ISA from IBM,three instruction widths are supported (2 byte, 4 byte and 6 byteinstruction widths). In that ISA, an instruction always includes anopcode field in the first bytes, the opcode having 2 bits that specifythe length of the instruction. The processor can take advantage of thisto determine where the next instruction begins, by interrogating the 2bits of the opcode that are always in the same first byte of allinstructions of the ISA for example.

A prefix instruction could be created that dynamically determines whichinstruction to modify. There can be a counter to modify X instructionsahead where X is a runtime variable determined by the contents of ageneral purpose register in an embodiment. Even a range could bespecified such as modify future instructions in program order, from Xinstructions ahead to Y instructions ahead where each are variablesgiven by specified general purpose registers for example. Themodification could be to modify the length field of this range ofinstructions to be a specified value from a third general purposeregister.

The forgoing is useful in understanding the terminology and structure ofone computer system embodiment. The present invention is not limited tothe z/Architecture or to the description provided thereof. The presentinvention can be advantageously applied to other computer architecturesof other computer manufacturers with the teaching herein.

While the preferred embodiment of the invention has been illustrated anddescribed herein, it is to be understood that the invention is notlimited to the precise construction herein disclosed, and the right isreserved to all changes and modifications coming within the scope of theinvention as defined in the appended claims.

1. A computer program product, the computer program product comprising atangible computer readable storage medium having program code embodiedtherewith, the program code readable by the computer to perform a methodcomprising: fetching, by a processor, at an address specified by aprogram counter a prefix machine instruction and a first next sequentialinstruction (NSI), the prefix machine instruction and the first NSIdefined for a computer architecture, the first NSI directly followingthe prefix machine instruction in program order; and executing thefetched prefix machine instruction and first NSI, the executingcomprising a)-c): a) modifying a field of the fetched first NSI based ona value specified by the prefix machine instruction to produce amodified first NSI; and b) executing the modified first NSI; and c)incrementing the program counter to point to a second NSI, the secondNSI directly following the first NSI in program order; and executing thesecond NSI.
 2. The computer program product according to claim 1,wherein the field of the first NSI consists of any one of an immediatefield, an index field or a length field.
 3. The computer program productaccording to claim 1, wherein the prefix instruction further comprises aprefix register field, the modifying further comprising: obtaining thevalue from a register specified by the prefix register field; andreplacing the field of the fetched first NSI with a replacement valuebased on the value specified by the prefix machine instruction.
 4. Thecomputer program product according to claim 3, wherein the methodfurther comprises: wherein based on the prefix register field being anyone of one or more prefix register field values, the modifying furthercomprising: obtaining the value from a low order portion of the registerspecified by the prefix register field; performing any one of a logicalOR, AND or EXCLUSIVE OR of the value with the field of the fetched firstNSI to form the replacement value.
 5. The computer program productaccording to claim 3, wherein the method further comprises: based on anopcode field of the first NSI comprising bits of the field of thefetched first NSI, aborting executing the fetched prefix machineinstruction and first NSI and signaling an error condition.
 6. Thecomputer program product according to claim 3, wherein the methodfurther comprises: based on information provided by the prefix machineinstruction, determining a location in the fetched first NSI of thefield of the fetched first NSI.
 7. The computer program productaccording to claim 6, wherein the method further comprises: extractingthe information from a register specified by the prefix machineinstruction, the information defining the location of the field of thefirst NSI.
 8. The computer program product according to claim 1, whereinthe field of the modified NSI is larger than the field of the NSIwherein the field of the modified NSI comprises a value greater than anyvalue supported by the field of the NSI.
 9. A computer systemcomprising: a memory; and a processor coupled to said memory, theprocessor comprising an instruction fetch unit and an execution unit,the processor configured to perform a method comprising: fetching, bythe processor, at an address specified by a program counter a prefixmachine instruction and a first next sequential instruction (NSI), theprefix machine instruction and the first NSI defined for a computerarchitecture, the first NSI directly following the prefix machineinstruction in program order; and executing the fetched prefix machineinstruction and first NSI, the executing comprising a)-c): a) modifyinga field of the fetched first NSI based on a value specified by theprefix machine instruction to produce a modified first NSI; b) executingthe modified first NSI; and c) incrementing the program counter to pointto a second NSI, the second NSI directly following the first NSI inprogram order; and executing the second NSI.
 10. The computer systemaccording to claim 9, wherein the field of the first NSI consists of anyone of an immediate field, an index field or a length field.
 11. Thecomputer system according to claim 9, wherein the prefix instructionfurther comprises a prefix register field, the modifying furthercomprising: obtaining the value from a register specified by the prefixregister field; and replacing the field of the fetched first NSI with areplacement value based on the value specified by the prefix machineinstruction.
 12. The computer system according to claim 11, wherein themethod further comprises: wherein based on the prefix register fieldbeing any one of one or more prefix register field values, the modifyingfurther comprising: obtaining the value from a low order portion of theregister specified by the prefix register field; performing any one of alogical OR, AND or EXCLUSIVE OR of the value with the field of thefetched first NSI to form the replacement value.
 13. The computer systemaccording to claim 11, wherein the method further comprises: based on anopcode field of the first NSI comprising bits of the field of thefetched first NSI, aborting executing the fetched prefix machineinstruction and first NSI and signaling an error condition.
 14. Thecomputer system according to claim 11, wherein the method furthercomprises: based on information provided by the prefix machineinstruction, determining a location in the fetched first NSI of thefield of the fetched first NSI.
 15. The computer system according toclaim 14, wherein the method further comprises: extracting theinformation from a register specified by the prefix machine instruction,the information defining the location of the field of the first NSI. 16.The computer system according to claim 9, wherein the field of themodified NSI is larger than the field of the NSI wherein the field ofthe modified NSI comprises a value greater than any value supported bythe field of the NSI. 17-22. (canceled)